by Iv · 10y ago · 0 comments
The thing is that basic programs were not entered through a 2D text-editor per rather line per line. You would type "LIST" to re-read the whole program you typed so far, with the lines in the correct order. Then, you would enter a line starting with a number. It would overwrite any existing line with the same number.
Typically, a way to correct the program you wrote would be to type:
30
15 PRINT "2"
(replace the line 30 by an empty line, and insert a line number 15)
You can get around that with some flags, but its more of a pain than its worth.
We tend to go by hundreds for programs, and we have a renumber command, but using it is the nuclear option because it will break goto line number references from outside programs (yeah, that's a very common thing in this language)
FOR i$ FROM 1 TO 10 STEP 2
PRINT i$
NEXT
and get back 2, 4, 6, 8, 10, each on its own line.I don't remember a command to set the increment for line numbers, but that may be because I never used a BASIC which didn't either require a number on every line or not care about line numbers except as targets for GOTO and similar.
17 GOSUB 5500