Hello All. Please see the code below, it being compiles but does not running (the error message is popped-up: “Enumerator do not points to allowable element” (translated from Russian)). I would appreciate if you can check it, and give a comment (or – the best scenario is to have a link to relevant information for studying). Thank you in advance, Oleksandr
{
/*
Define container of integer values:
[8, 16, 4, 70, -20, 14, 14, 3, 255, 45, 24, 100]
Convert it to the set of integers.
Remove all negative values from the set.
Output set using setEnumerator.
container con = [8, 16, 4, 70, -20, 14, 14, 3, 255, 45, 24, 100];
Set set;
{ */
Set is1;
int temp;
container contTemp;
SetEnumerator se;
container packedSet = [8, 16, 4, 70, -20, 14, 14, 3, 255, 45, 24, 100];
int len = conLen(packedSet);
is1 = Set::create([1, any2int(Types::Integer), len] + packedSet);//transfering of container to Set
se = is1.getEnumerator();
while(se.moveNext())
{
temp = se.current();
if(temp < 0)
{
is1.remove(temp);
}
info(strFmt("%1", temp));
}
}