reverse order in set collections

A-B-C-D-E → as not
E-D-C-B-A → want to get this as

How can I edit the following code ?

Thank you for everything

static void ReverseOrder(Args _args)
{
Set s1 = new Set(Types::String);
int i;
SetIterator si;
s1.add(“A”);
s1.add(“B”);
s1.add(“C”);
s1.add(“D”);
s1.add(“E”);
si = new SetIterator(s1);

while (si.more())
{
info(si.value());
si.next();
}
}

Set doesn’t keep sequence, think about using X++ List. This page can be used for reference: msdn.microsoft.com/…/list.aspx

Hi Kwen,
I know that it. Is there a way i want to research.

Thank you anyway.

Do you mean whether there is a way to make a set to keep items in a specific order? No, that would contradict the definition of set. It wouldn’t be a set anymore.

I want to get out of the rules. Just wondered.
Thanks anyway