List Class
Contains any number of elements that are accessed sequentially.
Lists are structures that can contain values of any X++ type.
All the values in the list must be of the same type. Type is defined when the list is created and cannot be changed.
All X++ types can be accessable using enum Types::
Lists can be traversed by using the Enumerator , ListEnumerator class. To create a ListEnumerator object, use List.getEnumerator.
First Example
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();
}
pause;
Second Example
List list1 = new List(Types::Integer);
List list2 = new List(Types::Integer);
List combinedList = new List(Types::Integer);
int i;
;
for(i=1; i<6; i++)
{
List1.addEnd(i);
}
for(i=6; i<11; i++)
{
List2.addEnd(i);
}
combinedList = List::merge(list1, list2);
print combinedList.toString();
pause;
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
06 October 2010
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
No comments:
Post a Comment
Give me the commetns and solutions