7.4

Table Of Contents
l "If (function)" (page 554)
Repeat... Until (procedure)
Repeat a sequence of commands until a condition is true. It is similar to a for... endfor loop in that you can nest the loops. It is
different from a for... endfor loop in that the loop always executes at least once, and that you tie the number of times the
loop repeats to a Boolean condition. For example you might tie the number of times the loop repeats to the occurrence of a
piece of data in the data stream.
Syntax
repeat
until( expression )
Argument
expression
Boolean value. If it evaluates to true, the loop ends. If it evaluates to false, the loop repeats.
Code Sample Example
This example prints the string Cheers’ ten times, one underneath the other, with a dashed line above and below the ten
instances.
Example
show('---------------')
crlf(0.16)
&count := 1
repeat
&count := &count + 1
show('Cheers')
crlf(0.16)
until(&count = 10)
show('---------------')
crlf(0.16)
Search EndSearch (procedure)
This command structure allows a series of nested commands to be repeated as long as a specific string of characters (the
search string) is found within another string (the target string). After each iteration, the target string contains all the data
between occurrences of the search string, excluding the search string. Once the loop is over, target contains the remaining
characters of the original data.
©2010 Objectif Lune Inc - 629 -