Do Loop Until
Command Description
Execute the following statement block, and after each execution, check whether the condition holds. If it does not hold, execute it again; if it holds, stop executing.
Command Prototype
Do
Loop Until expression
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
expression | True | expression | 1 > 0 | The expression used for judgment |
Demo
TracePrint("----------------------------Execute the statement block first and exit the loop when the conditional expression is true------ ----------------------------")
//-------------------------------------------------------------------------------
//[Remarks] When using Until , when the value of expression is false, continue to execute the Block statement block, and exit the loop when expression is true.
TracePrint("Let a=1, execute a to increment by 1 until a is equal to 10, exit the loop")
a = 1
Do
a = a + 1
Loop Until a=10
TracePrint(a)