Just working on the URLyBird project. The database spec says that fields are null terminated if less than the maximum length. The database file I have is not like this though, it is padded with spaces where a field is less than the maximum length.
I am wondering how to write to the file because if I null terminate a field and start the next field after the null character this will make writing to the database quite tricky as all the other fields will have to move.
If we are allowed to pad the fields with spaces to their maximum length then this makes things alot easier, but the spec does not allow this as far as I can tell.
Good day Rod.
I set each field to its maximum length before saving the record.
If the fields are not set to their maximum lengths, you will end up with records that do not have the same size. That means you will end up reading or writing to the wrong parts of the database and as a result you will end up with a corrupt database.
Each record must consist of fields that are set to the maximum length so that all the records will be the same length.
Champion, it's just that this has been discussed a lot before around here, you know... try searching for an answer using the Search engine. I'm sure you'll find a lot of good points in the discussions that went on already!