End Do-While
Executes a block of instructions as long as the defined condition is true.
Command availability: IBM RPA SaaS and IBM RPA on premises
Dependencies
This command can only be used to define a block of the Begin Do-While (repeat
) command.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
until --left(Variant) --operator(ConditionalOperators) --right(Variant) [--negate(Boolean)]
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Left Operand | left |
Required |
Any |
Value used to evaluate the condition. If the defined variable is of type Number, the default value is 0. |
Operator | operator |
Required |
ConditionalOperators |
Rule used to evaluate the condition. For more information, see operator parameter options. |
Right operand | right |
Required when Operator is Equal_To, Greater_Than, Greater_Than_Equal_To, Less_Than, Less_Than_Equal_To, Contains, Ends_With, Begins_With, Matches |
Any |
Value that is compared to the Left operand to evaluate the condition. |
Negate | negate |
Optional |
Boolean |
Negates the condition defined in Operator. |
operator
parameter options
The following values are supported for the Operator expression that evaluates the condition.
- Begins with
- Contains
- Ends with
- Equal to
- Greater than
- Greater than or equal to
- Is empty
- Is null
- Is null or empty
- Is true
- Less than
- Less than or equal to
- Matches
Example
The following example increments the value of the variable by one during the loop. It prints the result of the after the loop is done.
defVar --name incrementedVariable --type Numeric
repeat
logMessage --message "${incrementedVariable}" --type "Info"
incrementVar --number ${incrementedVariable}
until --left "${incrementedVariable}" --operator "Less_Than" --right 10
logMessage --message "Final result ${incrementedVariable}" --type "Info"