Do...Loop Until
- Updated2024-09-12
- 1 minute(s) read
VBScript Language Directory > Control Structures > Do...Loop Until
Do...Loop Until
The loop continues to repeat a statement block until a condition becomes True. DIAdem executes the statement block at least once.
Do [Statements] Loop Until Condition
| Condition | Expression that uses a comparison operator to compare a value with another value or a variable with another variable. The result of the comparison is either True or False. |
| Statements | One or more statements that are repeated until the condition is True. |
Use the Do While...Loop to execute a statement group repeatedly without specifying the number of repetitions. Abort the loop with the Exit Do statement.
Make sure you change the variable in Condition in the statement block, in such a way that the condition is eventually true. If not, you have an infinite loop.
DIAdem runs through the loop five times. The iLoop variable then contains the value 6:
Dim iLoop iLoop = 1 Do Call MsgBox("Loop = " & iLoop) iLoop = iLoop + 1 Loop until (iLoop > 5)
Related Topics
Do While...Loop | Do...Loop Until | Exit | For...Next | For Each...Next | If...Then...Else | Select Case...Case...End Select | While...Wend | With