Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Small adjustment needed on recycle approach
Message
De
07/05/2003 12:18:24
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00785663
Message ID:
00785885
Vues:
24
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
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform