Hello
how does on go about finding the last record in a random file that has lots of records
Badger
Hey Pete, glad you are keeping an eye on this. I haven't opened a file for Random since the 90's either!
You can do that header calculation with RANDOM, too. Just assign the first however blocks you need for those extras, and start your file reading below that last record number. You could save 10 lines for header info, and use:
startread% = 10
GET #1, startread% + i, a
Just sayin'
Pete
Am confused as to what benefits Binary has over Random where you have defined field sizes in records.
Is it quicker to access or sort, more efficient for memory etc.?
How backwards compatible will it be with QB45 programs (believe it or not I still have some laptops using XP 32 bit)
Would you be OK for me to post some code samples showing how I currently store data for my programs then you can advise how Binary might be better?
Cheers
Am confused as to what benefits Binary has over Random where you have defined field sizes in records.
Is it quicker to access or sort, more efficient for memory etc.?
How backwards compatible will it be with QB45 programs (believe it or not I still have some laptops using XP 32 bit)
Would you be OK for me to post some code samples showing how I currently store data for my programs then you can advise how Binary might be better?
Cheers
I think if I was going to do a RA data base file today, I wouldn't, specially if it were to need lots of strings.
Pete's reply reminded of all the wasted space involved with RA in last reply.
Nope it would be Binary only to load and store. Use a Record divider with one character, why not CHR$(10) and another character to divide the fields maybe "|". Open for Binary and Load it or Download it as a giant string. Split the string to records then split the records as needed to fields. Then reverse that process to load it back to the file again after adding and editing all the data. I might not even need a Type definition, just an double array with Field names with values from each record going in and out. Probably could sort by array index number.
I wonder what I am forgetting?
Well I always liked data files I could edit in txt editor.
Steve, you change one thing in that index thing and you have to re-adjust everything.