some issues about storing variable lenght fields...
Posted: Wed Jan 18, 2012 2:28 pm
In a text-mode form I have 4 lines of 78 chars. The lines are indipendent (created by 4 @ GET commands) but they contain one long text. It happens that when the user need to add a word in the first line and the text doesn't fit, it is truncated and must be repeated at the start of the next line...
Porting this form to GUI I wondering which is the best way, since I also have to limit the char number (and i think I can do it) and the space on the printed form (and this is more difficult....)
I also created 4 fields in the database, char 78, TEXT1, TEXT2, TEXT3, TEXT4 = 312 bytes. This is lower than the standard 512 bytes of DBT file... about 70000 records * (512-312) = 14 MB saved...
Since a lot of these lines are empty I was thinking about normalizing the DB, creating a new dbf with fields:
DOCURECORD N 7
LINENUMB N 1
TEXT C 78
Index on docurecord, linenumb
Saving and retrieving the lines is done on the DBF, and only for not empty fields...
are there other possible solutions I can't foresse now ?
Porting this form to GUI I wondering which is the best way, since I also have to limit the char number (and i think I can do it) and the space on the printed form (and this is more difficult....)
I also created 4 fields in the database, char 78, TEXT1, TEXT2, TEXT3, TEXT4 = 312 bytes. This is lower than the standard 512 bytes of DBT file... about 70000 records * (512-312) = 14 MB saved...
Since a lot of these lines are empty I was thinking about normalizing the DB, creating a new dbf with fields:
DOCURECORD N 7
LINENUMB N 1
TEXT C 78
Index on docurecord, linenumb
Saving and retrieving the lines is done on the DBF, and only for not empty fields...
are there other possible solutions I can't foresse now ?