Here's one example I found that looks like a basic for loop
(from "init/std/base/main/brain/code/event/gui_event.dat")
Code:
// loc.res = true;
// [loc.res]*20
[true]*20
{
loc.val += "s";
loc.val += loc.i;
loc.val += ":v";
loc.val += Rnd(79);
loc.i += 1;
[loc.i > loc.obj2] break; // loc.res = false;
[loc.res] loc.val += "|";
}
The code I added shows that a constant can be used as the condition and a break statement will escape the loop. But only constants are accepted for the *n part. Is there a way to make an indefinite while loop from this? I know I found one other loop example with a different usage, but I can't locate it now.