Break

3.2.2 Break

DESCRIPTION

Break - immediately terminate the innermost for loop and proceed to the first command after the loop's enclosing right curly brace '}'. If the command is used outside of a for loop it reports a syntax error.

To skip the current loop without breaking the for command use the continue command.

SYNOPSIS

break

RETURNS

The command doesn't modify the exit code and leaves its value on the one returned by the previously executed command.

EXAMPLES

# Infinite loop
for (; 0 == 0; ) {

    # Wait for at least 20% update of the remote screen.
    # If it doesn't update for 10 seconds, break the loop.
    Waitfor update extent=20% timeout="10s" ontimeout="break"
}

- Use a combination of for, Waitfor and break to hold on execution until the remote desktop stops to update.