Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using A Buffer File
Message
 
À
06/12/2001 09:28:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00590334
Message ID:
00590552
Vues:
17
Claudio,

Scattering in the form's load won't work because the memvars will go out of scope as soon as the load event ends.

Look at it this way. In prior vesions of Fox we used memvars or arrays for editing data, why? Becasue we wanted a level of indirection on the data so we could easily allow the user to discard their work if they chose to. So why did we need memvars? Because if we made our GETs go directly against the table fields the changes were immediate saved and if the user wanted to reject their work we had to do a lot of stuff to put things back the way they were.

In fact the changes were never immediately saved to the table, if that were true then the disk light would flash on every ketstroke. So this means that with direct editing (fields not memvars) fox was buffering the data in memory and the GETs would be changing the memory buffer. The problem was that we had no control over if and when that memory buffer would be committed to disk. In VFP we have table buffering that gives us control over that memory buffer. So it is no longer necessary to use memvars or arrays for editing data. We can allow direct editing of the fields in the table and either do a TableUpdate() to save the buffer or a TableRevert() to discard he changes in the buffer.

It is well worth the few hours it wopudl take to experiment with and come to understand table buffering and use it from now on.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform