
7-6
Section
Details of BASIC Commands
213
renum
Syntax:
RENUM
[<new line number>][,[<old line number>][, <increment>]]
Description:
Command. Renumbers program lines.
Remarks:
<new line number> is the first line number to be used in the new sequence. It can be any valid
line number in the range : [1…65535]. If it is omitted then it has a default value of 10.
<old line number> is the first line number in the current program where renumbering should
begin from. It can be any valid line number in the range : [1…65535]. If it is omitted then it
defaults to the first line of the program.
<increment> is the increment to be used in the new sequence. It can be any valid integer in the
range : [1…65535]. If it is omitted then it has a default value of 10.
The
RENUM
statement also changes the line number references used in the program in
GOTO
,
GOSUB
,
IF
...
THEN
...
ELSE
and
RESTORE
statements.
If the
RENUM
statement would cause an invalid program number then it is not executed. An
“ILLEGAL FUNCTION CALL” error (code B005) will result.
Examples:
> 1 REM FIRST LINE
> 2 REM SECOND LINE
> 3 GOTO 3
> RENUM 100, 1
> LIST
100 REM FIRST LINE
110 REM SECOND LINE
120 GOTO 120
>
See also:
restore
Syntax:
RESTORE
[(<line number> | <label>)]
Description:
Statement. Resets the next data item to first item in the
DATA
statement specified by the line
number.
Remarks:
<line number> is any valid line number in the BASIC program containing a
DATA
statement. The
valid range is : [1
...
65535].
<label> is a BASIC program label. It references a line number somewhere in the BASIC program.
If the <line number> and <label> are omitted then the data pointer will be restored to the first
DATA
statement in the BASIC program.
If the specified <line number> does not exist in the BASIC program, an “UNDEFINED LINE
NUMBER” error (code B008) will occur.
Examples:
> 10 DATA 10, "HELLO", 1.6, "WORLD"
> 20 READ A, B$, C, D$
> 30 PRINT B$+" "+D$
> 40 PRINT A+C
> 50 RESTORE 10
> 60 READ A, B$, C, D$
> 70 PRINT A+C
> 80 PRINT B$+" "+D$
> RUN
HELLO WORLD
11.6
11.6
HELLO WORLD
See also:
DATA
,
READ
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...