Thanks Christof, I will try your suggestions
Paul
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Christof Wollenhaupt Sent: 26 May 2020 14:47 To: profoxtech@leafe.com Subject: Re: [SPAM] Memo bloat
Sent by an external sender ------------------------------
Hi Paul,
I have a table with a memo field. It contains ca. 970 records and the size of the FPT is ca 230KB. I added 161 records to the table, populating the memo field with several lines of text (the total size of all the text added was ca 700KB). In each case the memo field was a single replace (no memo = memo + ..., no replace memo with .... Additive). The FPT ended up as 234MB but a PACK MEMO reduced this to ca 935KB.
This doesn't sound like the memo file is actually written at once and only once. When you change a memo field in a table that is not exclusively open, then VFP always appends the new text to the file. With just one write operation, you should end up with padded versions of the content appended only once.
Could it be that you have code that replaces the memo field with itself or does SCATTER MEMO / GATHER MEMO. VFP isn't smart enough to detect if you put the same content into a memo field again and just appends it. That might happen on other records than the newly added one.
I would test this with just one record instead of 161. Make a copy of the FPT file, run the code to append the record, then make another copy of the FPT file and look at what is different. If the file is OK, try the same with three records which should reveal patterns, if you process the same record more than once.
-- Christof [excessive quoting removed by server]