Friday, 17 April 2020

READ/DATA/RESTORE belong with GOSUB and GOTO

....are not implemented. Deliberately. I did implement GOSUB GOTO and RETURN but under protest :) and it's bad, the RENUM command ignores them so if you renumber a program with GOTO and GOSUB in it won't work. There is actually an ON token but it doesn't do anything other than generate a syntax error.

But still one needs data. So I borrowed a concept from AppGameKit BASIC, which has substring functions, so that you can pass in CSV data (or seperated with any single character) e.g.

12/23/42/61

and there are two functions to split it up. One returns the number of substrings, sub.count(a$,"/") (obviously 4) and one extracts a substring sub.get$(a$,"/",2) so you can store your data in strings (or just in the program code) and access it this way.


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 ...