lundi 13 décembre 2010

How to use Data List Structure in Dynamics AX

 For example, this code shows how to fill a list with elements and some functions associated :

static void ListSample(Args _args)
{
    List list = new List(Types::Integer);
    Enumerator en ;
    ;
    list.addEnd(333333); // add the value at last
    list.addEnd(111111);
    list.addEnd(222222);
    en = list.getEnumerator();
   
    print list.elements(); //"print number of element"
  
    while (en.moveNext())
    {
        print en.current(); //display each element of the list
    }
   
    print list.toString(); // list : <333333, 111111, 222222>
    print list.definitionString(); // defintion of the list for example : List of Int
    pause;
}


Links : 
http://msdn.microsoft.com/en-us/library/aa498818.aspx

Happy Daxing!

1 commentaire:

  1. what if I want to get the value in the first position of the list and store it in another variable?

    RépondreSupprimer