MMBasic for Windows - alphas


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4344
Posted: 03:58pm 22 Feb 2022      

  Mixtel90 said  If you can #include a file that is a set of DATA statements then the first one could be a list of the restore points. You could have different programs load the same file, some may use all the restores and others only selected ones.

If it works like the PicoMite you can have calculated relative Restores too. Very nice for adventure games where the restore point is your room number. :)


Doesn't solve the problem ;-)

1. DATA works by maintaining a global pointer to the next piece of DATA to be READ.
2. RESTORE can set the pointer.
3. There is no mechanism for user code to read the pointer, only the DATA it points at.

The result is that if I write a piece of code that calls a SUB or FUNCTION (potentially from a 3rd party, i.e. a library) then it may change the global pointer and there's nothing either the caller or the callee can do about it except religiously ensure that every set of READs starts with a RESTORE and that within a set of READs they don't call any code out of their control which might change the global pointer.

It's not an MMBasic specific problem it's just a flaw in the whole BASIC DATA/READ feature that is irrelevant for small atomic single-developer programs.

Anyway I've moved past the point of expecting Peter to do anything about it. I knew there was a reason I was avoiding involvement in MMB4W .

Best wishes,

Tom