Commands and Statements

BASIC-SO

REM

The REM statement is used to insert commentary remarks into program text. Any instruction line that begins with REM following its line number is passed over, and program control passes to the next line. Within a remark, : (colon) is simply another character, not a statement separator.

REM

10REM THIS PROGRAM FINDS THE AVERAGE

20REM OF THREE NUMBERS

30INPUT A,B,C

40PRINT (A+ B+C)/3

50END

RENAME

The RENAME command changes the name of the specified file to the new filename. Only the directory reference (accessed with the DIR command) is altered; if pro- grams reference the old filename, a FILE NOT FOUND error message will result.

RENAME "old filename" TO "new filename"

RENUM

The RENUM command resequences line numbers in a program, whether they ap- pear at the beginning of a line or as the object of a OOTO statement. You can specify up to three optional arguments: the first is the new number of the first line to be renumbered, the second is the old number of the first line to be renumbered, and the third is the increment between lines. If you specify no arguments, the new number of the first line to be renumbered is assumed to be 10, all lines are renumbered, and the increment is assumed to be 10.

REN UM [new number][,[old number][,increment]]

20 INPUT A

40 PRINT "NEW:"; A

15 RANDOMIZE

5PRINT CHR$(12)

52 A1 = A*RND

58 A2 = INT(A1)

RENUM LIST

10 PRINT CHR$(12)

20 RANDOMIZE

30 INPUT A

40 PRINT "NEW:"; A

50 A1 = A*RND 60A2= INT(A1)

RESTORE

The RESTORE statement resets the READ pointer to the first DATA statement within program text. The DATA statements can then be reread. A line number can be specified following RESTORE; if included, data on the specified line will be read next.

6-20

Page 60
Image 60
Intel 9800758-02 manual Rem