Random access file
Posted: Mon Jan 06, 2025 12:53 pm
good morning everyone: can you indicate examples of random or direct access files in SuperBasic? routine that they write them and then read them? Thank you.
Yes, as usual
MOVEQ#0,D0dilwyn wrote: Mon Jan 06, 2025 4:29 pmbut what is the significance of the 4E75 7000 in your signature? Looks like it has the letters "Nup", but...
dilwyn wrote: Mon Jan 06, 2025 3:18 pm I ended up biting the bullet on this one and after spotting a few typos and spelling mistakes in the article ...
Updated version at https://dilwyn.theqlforum.com/docs/articles/index.html
A very clear article - thank you!
May I offer a couple of suggestions for your next version?
1. On page 5, a tiny, cosmetic typo - you end with:- I guess you meant "DIM entry$ ..."Code: Select all
"...and we can store the whole lot in an array called entry$: DIM array$(9,120)"
2. On (middle of) page 10, you mention:- Actually, for as long as the file is still open in exclusive mode (either with OPEN_NEW, OPEN_OVER or just OPEN), any subsequent attempt to open for reading (shared mode - OPEN_IN), will result in an "in use" error. Same would apply if you attempt to open exclusively a file still open in shared mode - this time the exclusive open call would fail with the error. It's a QDOS limitation in that the entire file is locked in exclusive mode, rather than just at the record or field level. I can't recall whether the excellent DBAS extensions offer a more granular exclusive-lock facility over plain QDOS files...Code: Select all
"If one program has a channel opened to the file with OPEN, no other program can do so, but other programs may be able to OPEN_IN a channel to that file to input something if really necessary..."
3. (Just a thought...) It might be wise to call-out the need to CLOSE any file opened (in any of the exclusive modes) after any data is changed - in order to persist those changes and before any attempt to re-open in shared mode is made.
Thanks again, Dilwyn for your generous knowledge sharing!
M.