For-Loop
For-loops are statements with a loop-expression, a loop condition and a statement body that are executed as long as a specified condition is met.
For-loops have the unique attribute, unlike while-loops and
do-while-loops, of having an executable
LOOP_EXPRESSION
, which is evaluated at the end of every loop cycle. This
LOOP_EXPRESSION
can be used to do repeating tasks at the end of a loop cycle, like
calling a function or increasing a counter.
Released in v0.10.0 - Please update your version to access this feature.
Syntax
Execution Schema
- Evaluate
INIT_EXPRESSION
, if it exists (Only the first time). -
Check
CONDITION
, if it exists, before running theSTATEMENT
. IfCONDITION
isfalse
, then the loop will be stopped! - Run
STATEMENT
ifCONDITION
wastrue
. -
If the loop was not stopped using
return
orbreak
, evaluateLOOP_EXPRESSION
after finishing the execution ofSTATEMENT
.