3 ms·
Microsoft BASIC was the crappiest BASIC in my experience and the C64 shipped a hugely outdated version of Microsoft BASIC. But even there, you had a few options
by hnlmorg 7mo ago
Microsoft BASIC was the crappiest BASIC in my experience and the C64 shipped a hugely outdated version of Microsoft BASIC. But even there, you had a few options for structuring your programs beyond one liners.
GOSUB was used for subroutines
DEF could create a function (limited to one line but they could be nested to allow more complex functions spanning multiple lines)
Then you had the obvious instructions for iteration, such as FOR
Apple BASIC, BBC Basic (BBC Micro) and Locomotive BASIC (Amstrad CPC) all supported enhancements for composing functions and subroutines. But the latter two are European systems to Americans missed out there.
The ZX Spectrum had been only the quarter of the memory of the C64 and was an intentionally budget device. So don’t expect any thrills there. But even that would have supported at least GOSUB.
I’m not going to argue that structured programming in BASIC was pretty. Because it wasn’t. But that doesn’t mean it wasn’t possible.
- pjmlp 7mo agoExcept doing it with line numbers and direct jumps wasn't structured, was faking it. You can be creative with jumps outside FOR...NEXT, and line numbers. Likewise GOSUB might not necessarily flow back as expected if the programmer gets creative. There is a reason a certain famous article existed. Or arrow diagrams for execution flow for that matter. QuickBasic, QBasic, HP Basic, AMOS, Turbo BASIC, S-BASIC, GFA BASIC, Acorn Basic, now those yes.
- hnlmorg 7mo agoAs said earlier, you could do the same with BBC BASIC https://www.bbcbasic.co.uk/bbcwin/tutorial/chapter17.html https://www.bbcbasic.co.uk/bbcwin/tutorial/chapter17.html Locomotive BASIC inherited a lot of features from BBC BASIC too. It was just the American 8bit dialects that were shit.