Difference between revisions of "Repeat..until"
From Wiki
m (added version info) |
|||
Line 18: | Line 18: | ||
{{1.5only}} | {{1.5only}} | ||
− | {{ | + | =See Also= |
+ | {{Flow Control}} |
Latest revision as of 17:59, 5 September 2007
Synopsis
repeat { } until ( expression )
Description
The repeat..until control structure executes the code block between the statements, and then evaluates the expression. This will make it so that repeat..until loops will always execute the code within the loop at least once. This command differs from the while command because the expression is evaluated prior to the code inside the code block, where while evaluates the expression after executing it's code block.
Example
set %str Hello , #spc , World repeat { set %str %str , ! str len %str } until #strres >= 30 display ok %str halt
The example above illustrates the difference between a repeat..until loop and a while loop. the exclamation point will always be concatinated to the end of the %str variable, and str len will be executed once before the test for #strRes >= 30 is first evaluated.
Note: | Only available in EasyUO 1.5+ |
See Also
Flow Control
- Flow control commands allow scripts to make decisions based on the evaluation of boolean expressions.
break | Jumps to first statement outside of loop |
call | Transfers execution to another script file |
continue | Jumps execution of a loop to next iteration |
exit | Exits a called script |
for | Creates a counting loop |
gosub | Transfers execution to the matching sub |
goto | Jumps to another part of the script given by a label |
halt | Stops the script |
if | Executes code based on the evaluation of an expression |
pause | Temporarily stops the execution of the current script |
repeat..until | Creates a loop that checks condition after execution |
return | Returns from a sub |
stop | Ends the script |
while | Creates a loop that checks condition before execution |