Honestly, this seems to me like you'd just make it a simple text file and then go to it and get this type of information
Now, since I wrote my data as STRING * 20 for those lookup values, all I do is GET the relevant record from the random file.
DIM returnvalue AS STRING * 20
OPEN "Lookup_file.txt" FOR RANDOM AS #1 LEN = 20
GET #1, x * 65536 + y * 256 + z +1, returnvalue
PUT #2, ,_TRIM$(returnvalue)
^That's all there is to it, since my text file looks like:
I like cheese corresponds to record CHR$(0) + CHR$(0) + CHR$(0).
Rootbeer is good corresponds to record CHR$(0) + CHR$(0) + CHR$(1).
Whoopie doopie do corresponds to record CHR$(0) + CHR$(0) + CHR$(2).
...and so on
As for x/y/z, they correspond to ASC(Lookahead$,1), ASC(Lookahead$,2) , ASC(Lookahead$,3).
A simple random length text file with all the data we could ever want to put in it, instantly retrievable with one simple GET. What could be any more efficient or simpler than that, with zero looping or millions of IF checks involved?
Now, since I wrote my data as STRING * 20 for those lookup values, all I do is GET the relevant record from the random file.
DIM returnvalue AS STRING * 20
OPEN "Lookup_file.txt" FOR RANDOM AS #1 LEN = 20
GET #1, x * 65536 + y * 256 + z +1, returnvalue
PUT #2, ,_TRIM$(returnvalue)
^That's all there is to it, since my text file looks like:
Code: (Select All)
I like cheese
Rootbeer is good
Whoopie doopie do
....and so on
I like cheese corresponds to record CHR$(0) + CHR$(0) + CHR$(0).
Rootbeer is good corresponds to record CHR$(0) + CHR$(0) + CHR$(1).
Whoopie doopie do corresponds to record CHR$(0) + CHR$(0) + CHR$(2).
...and so on
As for x/y/z, they correspond to ASC(Lookahead$,1), ASC(Lookahead$,2) , ASC(Lookahead$,3).
A simple random length text file with all the data we could ever want to put in it, instantly retrievable with one simple GET. What could be any more efficient or simpler than that, with zero looping or millions of IF checks involved?