Skip to content

Automatic line numbering

Craig Edwards edited this page Apr 28, 2023 · 3 revisions

Automatic line numbering

Line numbering in Retro Rocket BASIC is an all-or-nothing affair. Retro Rocket will examine your program when it loads it, and if the first character is a digit, the program is assumed to be line numbered. The line numbers you specify will be used without any adjustment, this will effectively enable use of GOTO and GOSUB in your program.

If the first character of your program is not a digit, the program is assumed to not have line numbers, and the interpreter will automatically number the lines for you starting at 10 with increments of 10. It is important to note that in this case, although you could still use GOTO and GOSUB it would be much more difficult in this scenario as you have to figure out the line numbers using your editor. As GOTO and GOSUB are discouraged anyway, and there are better alternatives such as FOR, REPEAT, PROC and FN, there are very few situations where GOTO or GOSUB are required in your program.

Clone this wiki locally