Continue

Continues the execution of a repetition structure from its beginning.

Command availability: IBM RPA SaaS and IBM RPA on premises

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.

continue

Dependencies

You must use this command inside a repetition structure block. The following commands start a repetition structure:

Example

The following example starts a repetition structure that runs 5 times. If the number in the counter variable is less than or equal to 3, it increments the variable nextLoop. Otherwise, the Continue command is called to prevent the increment of the nextLoop variable.

defVar --name counter --type Numeric
defVar --name nextLoop --type Numeric --value 1
for --variable ${counter} --from 1 --to 5 --step 1
    logMessage --message "Loop Number: ${counter}" --type "Info"
    if --left "${counter}" --operator "Greater_Than" --right 3
        continue
    endIf
    incrementVar --number ${nextLoop}
next
logMessage --message "Next Loop value: ${nextLoop}" --type "Info"