11-04-2023, 01:39 AM
(11-04-2023, 01:20 AM)JamesAlexander Wrote: I think there is a better way to do this using the SEEK command.
You can do this and go directly here, circumventing all of the random using BINARY symbols instead:
file$ = "c:\myfile.dat"
OPEN FILE$ for BINARY as #1
Z$= CHR$ (0) ' Null value, Gets 1 symbol at a time.
SEEK #1,10 : 'Seek out the 10th symbol of the file.
GET #1 , , Z$: 'Get the symbol.
Print Z$: 'Prints the symbol
CLOSE #1
You can do this too in GWBASIC and Qbasic both, and around the time of GWBASIC, you were limited to a FIELD length of about 128 characters or less...
But this is the way to access files efficiently at a byte level (unless you have another more recent way using file direct access).
Thanks James. I'll experiment with this. The records are of different lengths, so I may need to use fixed-length strings as also suggested.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) 
Please visit my Website at: http://oldendayskids.blogspot.com/

Please visit my Website at: http://oldendayskids.blogspot.com/

