Well, After several different method trials, I finally got a record save routine that isnt bound to any user defined field list - it just doesnt care! And here is a screenshot of the VERY FIRST record PUT into a test database consisting of 6 fields.:
unsigned char fname[11]; // character string of 10 chars (11 is terminator)
unsigned char lname[11];
unsigned char bday[9];
unsigned char atari; // single char (char or bool type)
long costa; // numeric type
long costb;
Data populated into the fields (so you can see the values):
strcpy(fname, "first-name");
strcpy(lname, "last--name");
strcpy(bday, "20240226");
atari = 'T';
costa = -123498; // -1234.98
costb = 98712; // 987.12
Going to work on the get routine now.
I also added a couple of functions to print the structure, and generate a piece of C code for the db structure to include in a program, revised the menu a bit, streamlined how I had implemented unsaved changes checks, and open file indicators (now on the bottom line). And I dropped the 2nd "table" art that appeared in the backdrop, now its just a DB icon in ATASCII. And I changed the CHAR type to TEXT (for strings), and created a new CHAR type for single chars - effectively the same as BOOL. I'm debating if I force logical adherence for bools at time of put (code size vs letting user program limit input).
I'll do another video after I get record GETs completed. And I will blog about it once I get it ready for use, and the example program complete. THe record starts at "first", and ends at the last "heart". The final character (04) is the data terminator.
Been busy working on a sample program to use the new DB features. Got adding records done. Working on browse now, which will allow delete, and invocation of the edit form (input form with flags to use existing data).
Got the bulk of the browser complete. Just need to get the loading of data from the db into the list controls.
With that working, I added the deleted/active flag. Got that working without any issue. I changed the test program to write 3 records, update 1, and delete 1, then read them back and display them and show their delete status.
Heres a dump of the data. Anything is yellow is active record, red is deleted. Its in two parts as it flowed off the screen. this first one also shows the record count and deleted count being set properly in the database header. Yes, the modified date is still empty. Without FujiNet-PC working properly, its hard to test this piece without drastically increasing dev time going to real hardware.
Here is the latter part of the 3 records which shows the deleted/active flag. 0x2A is deleted (asterisk):
The routine that does the delete is also capable of setting a record back active (undelete), and retrieving a records deletion status (get).
Going to work on the pack routine tonight, which is realtively straight forward. And start thinking about indexing. Without carrying too much memory around, I think an indexing program that physically rearranges records may be one answer. Still exploring options here.
Essentially the DB is usable now. Just need to build a packer, a browser, and write the docs.