statement/DO statement/DO
NAME
DO -- Defines a program loop
ABBREVIATION
DO None
EXIT None
LOOP lo <shift> O
UNTIL u <shift> N
WHILE w <shift> H
SYNOPSIS
DO [UNTIL <bool_arg>|WHILE <bool_arg>] <statements> [EXIT]
LOOP [UNTIL <bool_arg>|WHILE <bool_arg>]
FUNCTION
Performs the statements between the DO statement and the LOOP statement.
If no UNTIL or WHILE modifies either the DO or the LOOP statement,
execution of the intervening statements continues indefinitely. If an
EXIT statement is encountered in the body of a DO loop, execution is
transferred to the first statement following the LOOP statement. DO
loops may be nested, following the rules defined for FOR-NEXT loops.
If the UNTIL parameter is used, the program continues looping until the
boolean argument is satisfied (becomes TRUE). The WHILE parameter is
basically the opposite of the UNTIL parameter: the program continues
looping as long as the boolean argument is TRUE.
INPUTS
<bool_arg> - boolean argument. For example A=1 or H>=57
<statements> - statements to be executed
RESULT
Performs the statements between the DO statement and the LOOP statement
forever or until WHILE or UNTIL condition is satisfied.
EXAMPLES
DO WHILE A$="":GETA$:LOOP
NOTES
None
BUGS
None
SEE ALSO
FOR