how to get a value from a list in axapta

I declared a List named list:

list = global::strSplit(prevSecondaryFocus, limiter);

it has a value <“A001”,“M1”>

What I want is to get the A001 and store it in a variable and M1 to another variable.

please help me I dont know how to get a value from a list.

thanks

HI Leaan,

Try this

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

list.addStart(‘A001’);
list.addStart(‘M1’);

iterator = new ListIterator(list);
while(iterator.more())
{
packedList += iterator.value();
iterator.next();
}

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

print first;
print second;
pause;
}

Naresh Kolli

hie naresh can u pls help me with dis?

http://dynamicsuser.net/forums/t/59165.aspx

thank you!!