A terminal program loop which runs until the condition at the end of the loop is logically "true".
Repeat ... // programsegmemt ... [EndDo | Exit Do | Exit If...] Until condition
condition | : any numeric, logical or string condition |
The end of a Repeat...Until loop must contain a numeric, logical or string condition, which is evaluated after each execution of the body of the loop. If the condition is logically "true", a branch is taken to the program statement immediately after Until. Otherwise, the body of the loop is executed again.
The Repeat...Until loop is an exit tested loop. This means that the loop executes at least once and the test, whether or not, the condition is fulfilled is first performed at the end of the loop.
By using an Exit If... or Exit Do command, the Repeat...Until loop can be terminated regardless of whether the loop condition is fulfilled. EndDo can be used as well.
Dim a$
OpenW # 1
Repeat
a$ = Upper$(InKey$)
Until a$ = "A"
CloseW # 1
A loop which runs until lowercase or uppercase "a" is entered from the keyboard.
{Created by Sjouke Hamstra; Last updated: 04/03/2017 by James Gaite}