Equinox Online Help - Language Reference - A to Z

Home

Repeat ... End Repeat

Applies to
Syntax
repeat
statements
[Exit Repeat]
[Continue Repeat]
end repeat
Action[Statement] The statements enclosed between Repeat and End Repeat continue in an endless loop.
ScopeUsable anywhere.
Notes

The statements execute and control returns to the first line after the Repeat statement.

Exit Repeat passes control to the End Repeat statement. Continue Repeat causes control to return directly to the first line after the Repeat statement. You may nest Repeat to as many levels as required.

CategoryFlow Control
See Also Block_EndBlock, BreakPressed, Continue, Execute, EnableInput, Exit, For...Next, Goto, If_Then, Repeat_Until, Return, Sleep, Subtable, Switch, While_EndWhile
Example

The following example invokes a question and continues unless the correct answer is given.

number AnswerAttempt
string Answer

AnswerAttempt = 0

repeat
AnswerAttempt += 1

if AnswerAttempt > 1 then Alert "Wrong answer, try again!"

PopupSize ,,20,20
Answer = Input("What is the capital of England?")
if UpperCase(Answer) = "LONDON" then exit repeat
end repeat