Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Small adjustment needed on recycle approach
Message
From
07/05/2003 12:18:24
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00785663
Message ID:
00785885
Views:
25
this won't work. you are still blowding the memo file. just run your test 2, or 3 times. i have modified you test a little:
OldCompatible = set("COMPATIBLE")
SET COMPATIBLE on

use c:\temp\test

*CREATE TABLE c:\temp\test (Mem M)
*APPEND BLANK
*flush()
*?"after append blank:" + str(fsize("c:\temp\test.fpt"))

REPLACE Mem WITH SPACE(100000)  && pre-allocate
flush()

?"after pre-allocate:" + str(fsize("c:\temp\test.fpt"))

FOR i = 1 TO 1000
  REPLACE Mem WITH STUFF( Mem,  1+ 100 * (i-1), 100, PADR( REPLICATE( TRANSFORM( i), 100), 100))
ENDFOR
flush()
?"after replace     :" + str(fsize("c:\temp\test.fpt"))

USE
SET COMPATIBLE &OldCompatible
>I wish there was a good way. Pre-padding is one way, but, I think you still need exclusive access. Here's an example of using a memo without growing it:
>
>CREATE TABLE c:\temp\test (Mem M)
>APPEND BLANK
>REPLACE Mem WITH SPACE(100000)  && pre-allocate
>FOR i = 1 TO 1000
>  REPLACE Mem WITH STUFF( Mem,  1+ 100 * (i-1), 100, PADR( REPLICATE( TRANSFORM( i), 100), 100))
>ENDFOR
>USE
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform