Posted: 07:43am 04 Mar 2022 |
|
|
|
Pre-filled arrays would be nice, but are rarely available in BASIC. Also, you require an array for each data type as a minimum. DATA statements can contain any mix of data types providing you read them correctly. Last time I used screen RAM to store data was probably on a Speccy. lol The Nascom was better as it had several hidden characters per line which could store the data without it being seen.
The point of my silly demo, Jim, was to illustrate that the DATA can be handled like a read-only array. I would always avoid line numbers normally, but in this particular case there isn't really a substitute unless you create the label with something like
dataline1: DATA dataline2: DATA dataline3: DATA 'etc
n=11 'this is the data line pointer mylabel$ = "dataline"+str$(n) restore mylabel$ which is rather neat but slower. It does give the ability to split the DATA block into individual segments though.
The point is, as Tom has pointed out, there isn't a way to store built-in data on MMBasic platforms unless it's a kludge. You can use CSUBs as data stores where they are allowed but that's about it. You can only use files, arrays or "magic data" strings if you have a storage device otherwise you have to load them from DATA statements in your program - very inefficient. . Edited 2022-03-04 17:55 by Mixtel90 |