Page 1 of 1

FOR statement - documentation missing 2 versions

Posted: Tue Nov 02, 2021 11:25 pm
by p-OS
Besides the 3 versions of the FOR statement listed in the documentation (chapter 11.4) there exist two more !

For <var> = <expr1>,<expr2> [Step <expr3>] <loop-block> Next

Code: Select all

For i=1,10 Step 2
 DebugPrint(i)
Next

For <var> = <expr1>,<expr2> [Step <expr3>] Do <stat>

Code: Select all

For i=1,10 Step 2 Do DebugPrint(i)
Both will print

Code: Select all

1
3
5
7
9

Re: FOR statement - documentation missing 2 versions

Posted: Wed Nov 03, 2021 5:36 pm
by plouf
isnt the the 3 "generic version" describes it ?

yes i know is not pretty clean the way it is written, but i think its the "3"

Re: FOR statement - documentation missing 2 versions

Posted: Wed Nov 03, 2021 9:43 pm
by p-OS
No, the generic FOR statement has two variables , separated by comma , to be used as run variable/control variable.

My variants however have two values/vars, separated by comma, that define the start and end of the run. Thus the comma is an alternative to the TO keyword.
The second difference:
My variants do not support the local keyword.

Re: FOR statement - documentation missing 2 versions

Posted: Sat Nov 06, 2021 7:19 pm
by airsoftsoftwair
Those are not official so you use them at your own risk ;)