(11-19-2022, 04:59 PM)mnrvovrfc Wrote:(11-19-2022, 01:04 AM)bplus Wrote: Tut for @johnno56Don't forget to close the file when done.
Breaking the ice with Random access
This "tutorial" should have had "ERASE Record" right after the first put, then show the "comments" field to demonstrate a blank record is going to have data read back in again, then use "GET" to retrieve that first record.
But what if the user wants another field, after he/she did a bunch of records in this manner? What if the user wants "comments" to have more than 60 letters, a long time after he/she created his/her first database file? Why does "date" field have to have 10 characters and any date delimeters at all? These are a few questions and more that have to be answered...
Yeah, yeah, yeah I am already in danger of doing too much for johhno56.
Closing the file is important if you didn't know it gets closed when program run ends, good to do it officially.
The next thing I would do with this after I knew how make a record and add it to file would be to start a central Menu of tasks and first on that list would be to append a new record. Start a data entry screen... for adding and editing.
255 was reduced to 50 so record fit across screen without starting a new line. BTW I had to delete old file when I changed from 255 chars to 50 for comment because after first old entry it was reporting 4.xx records, ha!
To erase or delete a record is a little more advanced than a simple edit, you'd have to rewrite the file to reduce the record count, same with changing or adding fields...
Gotta leave some fun for Johnno to figure out ;-))
Lets see how serious he is about all this data-basing stuff. I've already done more than he in his research I bet.
b = b + ...