End While

Command group Flag affected Reversible Execute on client Platform(s)
Constructs NO NO YES All

Syntax

End While

Description

This command marks the end of a While loop. When the condition specified at the start of the loop is not fulfilled (testing the flag or calculation) the command after the End While command is executed. Each loop that begins with a While command must terminate with an End While command, otherwise an error occurs.

Example

Calculate lCount as  1
While lCount<=3 ## While loop
  Calculate lCount as lCount+1
End While
OK message {Count=[lCount]} ## prints 'Count=4'
Calculate lCount as 1
Repeat ## Repeat loop
  Calculate lCount as lCount+1
Until lCount>=3
OK message {Count=[lCount]} ## prints 'Count=3'