Keyword Repeat - leonard-thieu/monkey GitHub Wiki

Marks the start of a Repeat loop.

Syntax

  Repeat    Statements...   Until Expression

  Repeat    Statements...   Forever

Description

A Repeat/Until loop repeatedly executes the statements within until the expression is true.

A Repeat/Forever loop repeatedly executes the statements within indefinitely.

Because the expression test occurs at the end of a Repeat/Until loop, the code inside will always be executed at least once. (Note that this contrasts with a While loop, where the expression is tested at the start of the loop, meaning the code within may be skipped if the expression proves False.)

The Exit keyword can be used to 'jump out' of the loop, continuing execution after the closing Until or Forever.

See also