Database
#19
I've had to do so much work with files throughout the years. I don't find it fun for some reason. Maybe because it is not very creative. RA files have the advantage of being easy to overwrite records, but you either need to know the entry length max values or you have to do a hack where the length you open the file is 2-byes longer than the record you are entering. This works, but if you ever open up the file in notepad, it's rally ugly. Nothing lines up data field-wise. Sequential files don't have the file length dependency, but a record cannot be easily overwritten. To do requires you rewrite the entire file. The speed of QB64, especially when using the OPEN FOR BINARY as a faster way to access a SEQUENTIAL file, that I don't really consider it that much slower than using the RA method. Inserting entries for both requires either shuffling for RA files or rewrite part, insert new, and rewrite to end for sequential files. Finally, a neat thing I like about sequential organization is delimited data. You can pick a delimiter like a comma or the pipping symbol "|" or really what ever you want, including ASCII characters 0 - 255 if using _CONTROLCHR OFF. Anyway, for comma delimited files you would have...

date,time,value,notes or for piping: date|time|value|notes

Easy to retrieve the data as a single line and then just parse out the date, time, value, and notes with INSTR(). Programs like Excel Spreadsheets use this CSV (comma-separated values) format.

Good luck with t, and you have plenty of people resources here who can help you out along the way.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply


Messages In This Thread
Database - by johnno56 - 11-18-2022, 08:44 AM
RE: Database - by mdijkens - 11-18-2022, 09:28 AM
RE: Database - by mnrvovrfc - 11-18-2022, 12:30 PM
RE: Database - by bplus - 11-18-2022, 01:35 PM
RE: Database - by SpriggsySpriggs - 11-18-2022, 02:13 PM
RE: Database - by Kernelpanic - 11-18-2022, 04:31 PM
RE: Database - by CharlieJV - 11-19-2022, 05:05 PM
RE: Database - by SMcNeill - 11-18-2022, 02:17 PM
RE: Database - by mdijkens - 11-18-2022, 02:37 PM
RE: Database - by bplus - 11-18-2022, 03:16 PM
RE: Database - by Kernelpanic - 11-18-2022, 03:38 PM
RE: Database - by johnno56 - 11-18-2022, 08:45 PM
RE: Database - by mnrvovrfc - 11-18-2022, 11:26 PM
RE: Database - by bplus - 11-19-2022, 01:04 AM
RE: Database - by mnrvovrfc - 11-19-2022, 04:59 PM
RE: Database - by bplus - 11-19-2022, 05:58 PM
RE: Database - by johnno56 - 11-19-2022, 08:02 PM
RE: Database - by bplus - 11-19-2022, 08:11 PM
RE: Database - by Pete - 11-20-2022, 06:55 AM
RE: Database - by mnrvovrfc - 11-20-2022, 08:17 PM
RE: Database - by bplus - 11-20-2022, 08:58 PM



Users browsing this thread: 7 Guest(s)