Skip to main content
Version: v6.5.0

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

ParameterRequiredTypeDefaultDescription
expressionTrueexpression1 > 0The 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)