When-You-Type-Condition-Establishment,--Cycle-Execution-Operation
Command Description
Regarding the use of "While", the program will continue to execute the block when the conditional expression is true, whereas the program will exit the loop when the conditional expression is 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