09.02.2008, 19:11 | #1 |
Участник
|
Ruslan Goncharov: Quick sorting in info messages
Источник: http://rusgon.blogspot.com/2008/02/q...-messages.html
============== Sometimes developer face the problem formatting of information messages to user, namely how to sort any items in message especially without duplications. Don't design own sorting algorhytms indeed. Let's use class Set. The question is toString() method automatically sorts the values and supresses duplicate values. Following job illustrates how to prepate formatting message using toString() method. X++: static void JobSetSorting(Args _args) { str out; set is = new set (types::Real); ; is.add(0.5); is.add(1.25); is.add(1.0); is.add(3.0); is.add(0.5); out = is.toString(); out = strReplace(out,"{", ""); out = strReplace(out,"}", ""); //out = strReplace(out,",", "/"); box::info("In fact: "+out); }
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|