Do While Loop
Command Description
When the condition is true, the following block of statements is executed repeatedly until the condition becomes false.
Command Prototype
Do While expression
Loop
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
expression | True | expression | 1 > 0 | The expression used for judgment |
Demo
TracePrint("--------------------------------------Conditional loop--------- ----------------------------------")
//-------------------------------------------------------------------------------
//[Remarks] When using While , when the value of expression is true, continue to execute the Block statement block, and exit the loop when expression is false.
TracePrint("Let a=1, start the conditional loop when a=1, make a increment by 1 in the loop, at this time a = 2, do not meet the loop condition, exit the loop")
a = 1
Do While a = 1
a = a + 1
TracePrint a
Loop