Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 146
Chapter
Commands
10
10 -16
Use the REN command to renumber program lines.
Important:
REN command updates the destination of GOSUB, GOTO, ONERR,
ONTIME and ON GOTO statements (Chapter 11).
If the target line number does not exist, or if there is insufficient
memory to complete the task, no lines are changed and the message
RENUMBER ERROR
appears on the console screen.
Because the REN command uses the same RAM for renumbering as it
does for variable and program storage, available RAM may be
insufficient in large programs. Renumber your program periodically
and in segments during development.
Syntax
This command variation:
Renumbers the program:
REN
Return
from the beginning of the program. New line
numbers begin at 10 and increment by 10.
REN
NUM
Return
from the beginning of the program. New line
numbers begin at 10 and increment by NUM.
REN
NUM1
,
NUM2
Return
from the beginning of the program. New line
numbers begin with NUM1 and increment by NUM2.
REN
NUM1
,
NUM2
,
NUM3
Return
starting at NUM2. New line numbers begin with
NUM1 and increment by NUM3.
Examples
>REN
Result: Renumbers the entire program. First new line number is 10.
Line numbers increment by 10.
>REN 20
Result: Renumbers the entire program. The first new line number is
10. Line numbers increment by 20.
>REN 300,50
Result: Renumbers the entire program. The first new line number is
300. Line numbers increment by 50.
>REN 1000,900,20
Result: Renumbers the program from line 900 on up. Line number
900 becomes line number 1000. Any following line numbers
increment by 20.
REN
Chapter