Skip to main content

Timeline for Why did BASIC use line numbers?

Current License: CC BY-SA 3.0

5 events
when toggle format what by license comment
Feb 26, 2016 at 23:39 comment added dan04 Some BASICs (e.g., Atari's) even allowed arbitrary numeric expressions to be used in GOTO statements. So, with a proper line numbering convention, you could write GOTO 1000+N*100 to emulate a switch statement.
Feb 12, 2016 at 12:28 comment added dave_thompson_085 Minor: FORTRAN required labels for targets of GOTO (or ASSIGN) and the original aka arithmetic aka threeway IF, and (rarely used) alternate returns in CALL, and sort-of-targets (arguably delimiters) of DO, and FORMAT statements. On other statements they were optional.
Feb 11, 2016 at 21:34 comment added Stack Exchange Broke The Law GCC allows computed GOTOs as an extension (although not with a line number directly of course) - you can do stuff like goto array_of_labels[some_computation()];
Feb 11, 2016 at 10:31 comment added Kickstart Ah, computed and assigned gotos. Memories of arrays of label variables in PL/1, looping through one array to find a match and then using that matches array index as the index in the array of label variables to do a goto to. Or Cobol altered gotos. And neither using line numbers! BBC basic had a renumber statement that was very useful.
Feb 10, 2016 at 15:08 history answered Mike Harris CC BY-SA 3.0