While
ActionStep Reference » Programming » Flow Control » While
The While ActionStep repeats all ActionSteps embedded in the inner node as long as the While condition is fullfilled, i.e. logically returns True.
.
- Open the Programming node in the Workspace Explorer.
- In the Flow Control node, select the While ActionStep.
Parameters:
The ActionStep has the following input parameters:
NAME |
DESCRIPTION
|
---|---|
Left Expression item |
The initial ActionStep, parameter, or value to be compared.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Result, Enum] |
Operator
|
The operation to be used when comparing the expressions.
Allowed Context Scope [Fixed] |
Right Expression Item
|
Another ActionStep, parameter, or value to be compared.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Result, Enum] |
An infinite loop will occur when the specified condition does not result in a false value. |
Example 1 (Displays iterated number values):
This example loops the values of a local variable named numValue with Number as data type. When the loop stops, a Text is then output via Message Box.
Example 2 (Plays a beep in a loop):
This example runs a continuously beeping sound and compares the values of two local variables named Temp Reading and Temp Limit with Floating Point as data type. When the loop stops, a Text is then output via Message Box.
See other Flow Control ActionSteps:
If
For Loop
For Each
Repeat Until
Break
Label
GoTo
Parallel
On Error Continue
On Error GoTo
Abort
Abort on Error