Hi,

I am an X++ beginner. To get used to the syntax I am making different
classes. Now I am making a ContainerList class that wraps a container.
My add method looks like this:

void add(int _i,  int _index=conlen(_list)+1)
{
     _list = conins(_list, _index ,_i);
}

and my main:

static void main(Args args)
{
    ContainerList cl = new ContainerList();
    cl.add(1);
    cl.add(800);
    cl.add(3);
    cl.add(500,5);

    print(cl.get(2));
    print(cl.get(5));

}

When I run this example I get the output
800
0

If I look at index 4 instead of 5 I get the value 500 printed. Why is
the value 500 not inserted at index 5 but instead 4? Don't the
container type not allow empty spaces?







SPONSORED LINKS
Microsoft business solution Microsoft axapta Basic programming language
Computer programming languages Programming languages Java programming language


YAHOO! GROUPS LINKS




Reply via email to