FOR statement - documentation missing 2 versions

Report any Hollywood bugs here
Post Reply
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

FOR statement - documentation missing 2 versions

Post 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
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: FOR statement - documentation missing 2 versions

Post 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"
Christos
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Re: FOR statement - documentation missing 2 versions

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FOR statement - documentation missing 2 versions

Post by airsoftsoftwair »

Those are not official so you use them at your own risk ;)
Post Reply