Wednesday, June 1, 2011

How to use "LIST" in Axapta...


Simple and small example how use the "LIST"....

static void List_Example(Args _args)
{
    List                list = new List(Types::String);
    container       packedList;
    ListIterator    iterator;
    str                 first,second;
    ;

    list.addStart('A001');  // Adding the string variable to LIST
    list.addStart('M1');     // Adding the string variable to LIST

    iterator = new ListIterator(list);
    while(iterator.more())
    {
        packedList += iterator.value();    // Adding the variables from LIST to a container.....
        iterator.next();
    }

    first       =  conpeek(packedList,1);
    second  = conpeek(packedList,2);

    print first;
    print second;
    pause;
}


No comments:

Post a Comment