Tuesday, 5 May 2020

Breaking change

We all make mistakes. One early mistake I made was copying (partly) the old thing in Microsoft BASIC where you didn't have to declare variables at all.

If you do this in Microsoft BASIC it will just print "0" ; the default value, as do versions prior to 0.93

It now requires you to declare variables. There are three ways to do this - an assignment statement, a LOCAL statement, and as a procedure parameter. (Well, four if you include DIM, but that's something different).

Running the games so far shows why. Most worked fine. Asteroids didn't, because the RPL code that does the movement and collision checks accessed variables that didn't exist. There were a couple of mistakes - a game that should have been a game.score , but didn't matter because it was initialised to zero. Pacman had one mistake. Everything else works ... I think :)

I might make it optional again, but I probably won't. It's like GOTO GOSUB and RETURN. They're there ; RENUM ignores them to discourage you, really it's just for type-ins. I seriously considered disable the tokeniser code for those three.

So next up ; the Sprite microlanguage, a sort of high level compiler, and inline documentation for RPL words. The high level compiler is based something I've done before, it's very simple and clean and designed round the architecture of the machine.

No comments:

Post a comment

Breaking change

We all make mistakes. One early mistake I made was copying (partly) the old thing in Microsoft BASIC where you didn't have to declare ...