Показать сообщение отдельно
Старый 09.02.2008, 19:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
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);
}
Источник: http://rusgon.blogspot.com/2008/02/q...-messages.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.