Do Until Loop
Command Description
When the condition is not met, the following block of statements is executed in a loop until the condition is met.
Command Prototype
Do Until expression
Loop
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
expression | True | expression | 1 > 0 | The expression used for judgment |
Demo
TracePrint("------------------------------------ Loop when condition is not true------- ------------------------------------")
//-------------------------------------------------------------------------------
//[Remarks] When using Until , when the value of expression is true, the execution of the Block statement block is continued, and when the value of expression is false, the loop is exited.
TracePrint("Let a=1, when a is not equal to 10, execute a self-increment by 1 until a is equal to 10, exit the loop")
a = 1
Do Until a=10
a = a + 1
Loop
TracePrint(a)