Do...Doend. DORIC 9.65, INFO-Text software
Quảng cáo
Quảng cáo
DO...DOEND
DO
.
.
.
W
HILE
U
NTIL logical_expression
DOEN
D
allows you to perform a sequence of commands repetitively in an
INFO program.
arguments notes
WHILE instructs INFO to repeat the sequence of commands as long as the logical expression is true. This is the default when neither UNTIL or WHILE are specified.
UNTIL instructs INFO to repeat the sequence of commands until the logical expression is true.
logical_expression statement that INFO evaluates at the top of the DO loop.
n
DO and DOEND are two different commands that denote, respectively, the beginning and ending of the repeated sequence of commands. The DO command instructs
INFO to repeat the INFO commands bounded by the DO and DOEND commands according to the condition specified by the option and logical expression in the DO command.
n
Up to 100 DO...DOEND pairs can be nested in one INFO program.
n
If you include a DO command in an odd-numbered program section, avoid referencing data file items in the commands within the DO...DOEND group unless you wish to process the entire selected set.
n
To test the value of an item in a selected record or corresponding related record in an odd program section, use MOVE or CALCULATE to assign the item value to an appropriate system variable and test the value of the system variable.
INFO Reference Manual Commands 185
DO...DOEND
example
20000 PROGRAM SECTION TWO
For the selected
20001 DO WHILE $NUM1 LE 4
20002 CALCULATE QTR = QTR + MNTH
record currently positioned, perform a
20003 CALCULATE $NUM1 = $NUM1 + 1
sequence of commands.
20004 DOEND
186 Commands INFO Reference Manual
Tải xuống
Quảng cáo