3 ms·
How do you speculate GOTO works if the tokenized program doesn’t have line numbers? Or if I write 5 REM MY COOL PROGRAM 10 PRINT “HELLO” 20 GOTO
by wang_li 3y ago
How do you speculate GOTO works if the tokenized program doesn’t have line numbers? Or if I write
5 REM MY COOL PROGRAM
10 PRINT “HELLO”
20 GOTO 10
Then later I write
10 PRINT “DIE BART DIE”
How does it know to replace the right line?
- flohofwoe 3y agoThe line number is stored in the program, just not as text. It's preparsed into a (usually 16-bit) integer as part of the 'tokenization' of the input line buffer.
- kragen 3y agoi don't think that flohofwoe was claiming the line numbers weren't stored, just that the textual representation with line numbers maybe isn't the correct measure