IBMs handbook for the compiler says in appendix A („Messages from the Compiler“):
SQ Sequence error
The line numbers in your program were not in sequence, or contained a duplicate statement number.
The BASCOM
compiler doesn't need line numbers on every line if the /N
option is given:
If you use a text editor other than the BASIC program editor, you can create a file of lines without line numbers. The compiler supports sequences of lines
without line numbers if the /N parameter is specified when you start the compiler. This feature can make it very easy to include the same file in many different programs.
In case of BASCOM
most probably memory and runtime was the reason to not read in the complete file into memory at once and sorting the lines according to line numbers. The compiler analyses the file line by line while reading them and is able to fail fast for many errors that need just the knowledge of a single line plus the information gathered from previously seen lines. This was an important point back then when it was common to run all of this from slow floppy disk drives.
The interpreter on the other hand treated BASIC programs read from text files simply as if the user manually entered them line by line. So the line number was used to determine the relative position to the other lines in the program.
Later dialects like QBasic treated line numbers just as labels. The following behaves like the well known classic in QBasic, but prints just one line in earlier dialects:
20 PRINT "Hello, World!"
10 GOTO 20
If each line has a line number it might be reasonable to expect them to be reordered before execution, although it might get confusing to the programmer that the order of the lines they edit, isn't the order the lines are executed when there are no statements that imply jumps.
Now imagine not all lines are numbered and the program is larger than just a two line toy example. Take this (incorrect) code for example:
GOSUB 100
FOR i = 1 TO 10: GOSUB 200: NEXT
END
200 PRINT "frobnicate"
RETURN
DATA 1,2,3
100 PRINT "Do some special preparation and"
PRINT "then fall through to frobnicate"
REM ...
DATA 4,5,6
What would reordering mean? It must be at least meaning to move all the lines following the line number up to the next line number (or label). What about DATA
lines? Move them too or leave them in the same order? It may very quickly become a mess for the human reader to understand the actual program flow in such a program.
Even with the interpreter, where having numbered lines out of order in a text source file is okay for the interpreter, I guess human readers will be confused easily and the programmer would use the sort lines function of the text editor of choice or an external sorting program. It's also easier to spot accidentally replacing earlier entered lines with the same line number then.
So there's not really a compelling use case for interpreters and compilers that don't need line numbers to reorder lines with line numbers (+ the following ones without) and working with „out of sequence“ lines is already confusing with interpreters that do require line numbers.