Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why my memo field become 21M long?
Message
From
04/02/1997 15:21:18
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00019120
Message ID:
00019249
Views:
36
>>>I write a app that recieve serial port data into a table
>>>by MSCOMM32.OCX.
>>> I use a memo field to save data what recieved , and per record is 100K long about,but when i have recieved 5 records , i find it's become 21M long!!! (the FPT file of this table) I don't know what is happend. or memo field has some fix block for saving data, they are fix long,and whatever they are used ?
>>> how can i try ?
>>> (If someone is interest it , i can post my code to him via E-Mail..)
>>> thanks everyone.
>>
>>
>>Memo fields use a specific block size. When the block is filled, the ENTIRE memo for that field is copied to the end of the FPT file and another block is reserved. The original space is NOT reclaimed. Use PACK MEMO to reclaim the space.
>>
>>Craig
>
>In addition to what Craig has said, here is the end portion of some tests we did
>trying to resolve the same issue.
>
>
>
>data table=test
>1 memo field name test
>1 record in place
>
>Test 4:
>
>REPL TEST WITH ‘‘
>PACK
>fpt size is 512
>
>for i=1 to 11776
> repl test with test+’*’
>endf
>
>len(test)=11776
>fpt size is 1,101,632
>
>PACK
>fpt size is 12,352
>Overhead of Replace + command is 1,089,280 in diskspace !!!!!!!
>
>Conclusion:
>If this were happening only during program execution, we might assume that a buffering effect
>was causing the memo field to grow. Since it also happens in manual, single line execution, we
>are going to assume that the replace test+ command is the cause. FoxPro may retain a portion
>of the memo field on disk, causing the growth.
>
>Further tests showed that the most conservative use of diskspace is to capture incomming
>communications to a variable. When the variable reaches 16K in size, write the data to a
>memo field for safety. Continue this pattern until the communication is completed, write the
>final variable data to the memo field.
>
>Use replace field+data in memo fields very conservatevly, infrequently.


This is the way memo fields have always worked!! Even going all the way back to the original Vulcan program from Wayne Ratliff. It works this way in dBase, Clipper, FoxPro, and all "xBase dialects".

Craig
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform