3 ms·
Ahh sorry, I was talking in the context of the microcomputer era of the late 70s and 80s rather than the full history of BASIC. Thanks for the PDF, that will m
by laumars 9y ago
Ahh sorry, I was talking in the context of the microcomputer era of the late 70s and 80s rather than the full history of BASIC.
Thanks for the PDF, that will make really interesting lunch time reading :)
> I do wonder if it was a true loop, though, or whether it was implemented more along the lines of GOSUB/RETURN (i.e. whether FOR basically set up a dynamic label, and NEXT did an indirect jump). If so, then it should be possible to have two FOR statements with the same variable, both "matched" to a single NEXT, if GOTO is used to reach it from one of the loops.
I could be wrong here but I think most high level structures (switch, for loop, etc) end up getting translated to GOTOs at the machine level anyway. So you might be right with regards to the BASIC interpreter.
As for whether you could have fun with that, Dartmouth is before my time but I remember Locomotive BASIC (Amstrad CPC 464, so we're talking early 80s) used to do run time checks to ensure you weren't abusing NEXT inside nested FORs.
- int_19h 9y agoI tried it on QBASIC and Turbo BASIC, and both require matching FOR and NEXT. Now I'm really tempted to set up a Dartmouth emulator to see if it was also true there...