Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    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. Commented Feb 11, 2016 at 10:31
  • 1
    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()]; Commented Feb 11, 2016 at 21:34
  • 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. Commented Feb 12, 2016 at 12:28
  • 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. Commented Feb 26, 2016 at 23:39