MMBasic for Windows - betas


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3782
Posted: 12:58pm 03 Mar 2022      

  Mixtel90 said  The DATA system on the PicoMite isn't a disaster now you can have relative RESTORE points. There's no need for READ loops to get to where you want. You can have as many pointers at you like pointing to the data block.


If the manual is correct then they aren't relative:

RESTORE [line]  Resets the line and position counters for the READ statement.
                If 'line' is specified the counters will be reset to the
                beginning of the specified line. 'line' can be a line number
                or label or a variable with these values. If 'line' is not
                specified the counters will be reset to the start of the
                program.

Relative would look like:

RESTORE [line_num|label], line_offset

or possibly:

RESTORE RELATIVE line_offset

where any of 'line_num', 'label' and 'line_offset' could be literals or variables.

Which I think would also provide a way to deal with the issue, provided you were careful in the arrangement of your DATA statements and were prepared to live with it all going haywire if you decided to add some comments or additional lines within the DATA statements.

I really was quite happy with CSUB and PEEK(CFUNADDR cfun).

Best wishes,

Tom
Edited 2022-03-03 23:14 by thwill