Menu ▾ ▴

#38 Review handing of memo file (dbf_memo.pas)

v1.0_(example)
open
nobody
None
5
2026-11-06
2026-11-06
Paul Baker
No

I reviewed dbf_memo.pas and noticed some things we should address. These are from my notes from years ago, so they will need refining and validation.

  1. We should use try/finally to make sure that a page is unlocked if there is an exception after locking a page.
  2. The handling of blocks could be more robust.
    • Appends when it does not need to if ReadSize is not set; ReadSize is only set when using bmReadWrite.
    • Appends when it does not need to; Needs to include bytesBefore + bytesAfter in calculation of existing block.
    • Ensure that it always creates new block on append record (ReadSize = 0)
    • Use of MemoRecordSize is not robust.
  3. File name is missing from the DBT file header.

Discussion


Log in to post a comment.