Hi !
I'm trying to apply certain code to every element of an array by using this forEach loop:
{ call compile format ["
while {true} do {
if (!(isNil ""%1"") && !(isNull %1)) then {
...
<snip>omitted because of irrelevance</snip>
...
};", (_x select 0), (_x select 2)];
sleep 0.123;
};
} forEach somePublicVariable;
For some reason it will only iterate to the first index, while this code bock here works just fine:
{ call compile format ["
if (!(isNil ""%1"") && !(isNull %1)) then {
...
<snip>omitted because of irrelevance</snip>
...
};", (_x select 0), (_x select 2)];
sleep 0.123;
} forEach somePublicVariable;
What's wrong with that while loop ? What am I missing here ? ... :confused:
I simply can't explain this to myself and any insight would be greatly appreciated.
Cheers !
DC