Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
RUN Statement Programming Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
'This example uses the RUN statement to restart the program. The example
'shows that RUN resets all numeric variables to 0. As the line number
'following RUN increases in lines 60, 70, 80, and 90, the variables
'in the earlier statements lose their assigned values.
10 A = 9
20 B = 7
30 C = 5
40 D = 4
50 PRINT A, B, C, D
60 IF A = 0 THEN 70 ELSE RUN 20
70 IF B = 0 THEN 80 ELSE RUN 30
80 IF C = 0 THEN 90 ELSE RUN 40
90 IF D = 0 THEN END ELSE RUN 50
'Sample Output
'
'9 7 5 4
'0 7 5 4
'0 0 5 4
'0 0 0 4
'0 0 0 0