Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 1.85 KB

README-FlowControl-Loops.md

File metadata and controls

55 lines (46 loc) · 1.85 KB

LOGO

1. Flow Control - Loops

forTime and forCondition are loops and belong to flow control also:

forTime takes a single argument "time" - it repeats the loop until "time" in milliseconds has passed since the initialization of the loop. See an example of forTime() below:

...
	$i = 0
	forTime(2000)
		console.printLine($i, ": Hello World")
		script.wait(500)
		++$i
	end
...

forCondition takes a single boolean value as argument. The loop will be executed as long as the argument is true. In this case "$i < 5" translates to "lesser($i, 5)" which results in a boolean value, which is used as the forCondition argument. See example of forCondition() below.

...
	$i = 0
	forCondition($i < 5)
		console.printLine("$ = ", $i)
		++$i
	end
...

TODO: for, break, continue

2. Links

2.1. Language Documentation

2.2. Other Links