Feelin’ my age (part 4): Sinclair SuperBASIC on the QL
Before acquiring the QL the whole of my programming had been done in BASIC. I'd read about other languages but never used them. These BASICs were quite primitive or, in the case of the Level 1 BASIC on my 4Kb TRS-80 Model 1, extremely primitive.
SuperBASIC was so different. Later it occurred to me that it leaned more towards Pascal. It's certainly has much better support for structured programming than the standard basics. For example it had:
- Multi-line IF - THEN - ELSE - END IF statements.
- A generalised repeat loop construct: REPeat - NEXT - EXIT - END REPeat. This can be exited anywhere within the loop. An IF - THEN - EXIT statement test immediately after the REPeat statement acts as a while loop while a similar test immediately before an END REPeat statement acts like a repeat loop.
- Multi-line indexed loops syntax - FOR - NEXT - EXIT - END FOR.
- Case statements: SELect ON - ON - REMAINDER - END SELect.
- Return from anywhere within procedures, functions and loops with EXIT.
- LOCal arrays & variables.
I happily programmed using SuperBASIC for years without using a single GOTO statement. Although SuperBASIC has line numbers, you rarely had to refer to them.
The main thing to understand about the bad press that the QL attracted is that, true to form, Sinclair released it without bothering to finish it. And that means SuperBASIC was not what it could or should have been from the word go. Fortunately third parties came along with new ROMs & expansion cards that massively improved both the machine and SuperBASIC.
Another vendor released a SuperBASIC compiler. This meant that we could develop and test in the interpreter and release compiled code. Ideal.
Another feature of the QL was that SuperBASIC was used on the OS's command line. And I believe that procedure definitions could be used to effectively extend the OS. I seem to remember (but take this with a pinch of salt) that I used to load a SuperBASIC script after every boot to configure the OS and the windows just how I liked them. Because the script had no line numbers, the statements were executed immediately by the OS. If you know different, please let me know.
Eventually affordable Pascal and C compilers came along for the QL, which is where I developed my interest in, and love for, Pascal. Conversely it was then that I also realised how much I disliked C. Nah, forget the past tense, I still dislike C! I also determined that I needed to know more about this programming game.
So I popped off on a part-time college course where I learned BBC BASIC, Pascal (yey!) & COBOL (feelin' my age again). Multiuser minicomputers and BBC micros all the way. We also learned something fellow oldies may remember that's called Jackson Structured Programming - the design methodology de-jour back then, designed originally to make COBOL batch file processing easier to maintain and modify. Anyone else ever encounter that?
I did write an accounts package in compiled SuperBASIC for a preserved railway where a friend of mine was Treasurer. It was customised to his needs and remained in use for some years. Thinking about it, that was my one and only commission, albeit unpaid! Therefore I resolutely remain an amateur.
Maybe somewhere I've still got some 3.5 inch floppies with QL code on them, but I'm not sure. All that remains are some screen shots of some of my programs. Screen shots here being meant literally: they are photographs shot on 35mm film of my monitor screen. Feelin' old again!
So what's your favourite language of old, and is it still around?
Still thriving?
I'm pleased to see that the QL, and more particularly SuperBASIC, is still being used and supported by the retro computer community. Would I call it thriving? Nope, but it still appears to be alive and kicking.
Sadly, I'm not one of those who are still using it. But I'm glad that someone is.
Aside: An Encounter with Turbo Pascal
As an aside I remember writing a solution to the 8 queens program in Turbo Pascal on the PC as a competition entry. And here's another reason to feel old: entries had to be printed out or hand written and submitted by post. Didn't win, BTW.
That program eventually got converted into a Delphi 1 Windows 3.1 program and was rewritten again for Win 32. The Windows version still exists on my Google Drive and there's a mothballed page about it on my website.
There was also a Turbo Pascal implementation of John Conway's Game of Life that also got converted to Windows. That still has a mothballed page too.
Now i'm delphi programmer but i started with QL too!!!!!!
ReplyDeleteI wonder how many of us there are?
Delete