Welcome Guest. Please Login or Register. Apr 1st, 2018, 04:49am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
Re: RANDOM ACCESS LIBRARY?
« Reply #7 on: Oct 24th, 2015, 5:34pm »
I don't use Random Access Files because you can't access them randomly - unless you know the record number - which means a separate index file - which means more work keeping the index and main file in synch.
I think the simplest thing to do is use one-record files and access them (randomly !) with the file dialog statement.
which means more work keeping the index and main file in synch.
There's not much effort involved in keeping them 'in sync' because the only way they can ever lose synchronisation is when you rebuild the data file to recover the space occupied by deleted records. Typically you would perform that operation only infrequently.
Quote:
I think the simplest thing to do is use one-record files and access them (randomly !) with the file dialog statement.
That's likely to be very wasteful of disk space. Consider the classic example of a database - an address list. A record might need to be something like 200 bytes long to contain (for example) a name, address, telephone number and email. But the minimum amount of disk space occupied by a file (however small) is typically 4 Kbytes - and that doesn't take into account the size of the directory itself - so you could easily end up using more than 20 times the amount of disk space than your database should occupy!