RENUMBER
Format: RENUMBER or RENUMBER N
Supported by: COMX BASIC V1.00, Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0, Quest Super BASIC 3.0, 5.0 and 6.0, RCA BASIC3 V1.1, Telmac SBASIC v 24.3
Similar commands: -
The RENUMBER statement allows the user to renumber the lines within a program to a given increment. If no argument follows the RENUMBER statement, the increment defaults to 10, i.e., line numbers 10, 20, 30, and so forth. When n is given, it becomes the initial line number as well as the increment. The n value that is displayed for numbers above 256 will always be module 256. A warning message indicating the number of "computed branches" is issued. A "computed branch" is a statement requiring the computer to branch or jump to another statement the line number of which is yet to be determined. For example, consider the following program.
10 FOR A =1 TO 5 15 N(A) = 0 20 NEXT 25 GOTO 10 RENUMBER 20
will give the message
0 COMP BR
and LIST will give,
20 FOR A=1 TO 5 40 N=0 60 NEXT 80 GOTO 20
Note that the lines have been renumbered. Note also that the statement "25 GOTO 10" has become "80 GOTO 20" since the old line 10 has been renumbered 20. "GOTO 10" is not a "computed branch" (hence the message "0 COMP BR") because the computer is able to determine the line to branch or jump to.
Consider another example, with "GOTO 10" replaced by "GOTO 5*2" (or "GOTO B"),
10 FOR A=1 TO 5 15 N(A)=0 20 NEXT 25 GOTO 5*2 RENUMBER 20
will give the message.
1 COMP BR
and LIST will give.
20 FOR A=1 TO 5 40 N(A)=0 60 NEXT 80 GOTO 5*2
The warning message that there is one "computed branch" prints to the fact that one line, on this case, line 80, will give rise to error because of renumbering. "GOTO 5*2" (and "GOTO B") are examples of "computed branch".