Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>I am new to Visual Foxpro and used to program in Foxpro2.6
Thanks,....but when do I issue TABLEUPDATE() and TAABLEREVERT()?...should I put them the the 'click' event of the command buttons that I created for save and delete?
>>
>>I noticed one thing,..I can't seem to use scatter memvar in the forms,...how can I go about writing mem var before wirting to disk?
>>
>>somebody pls help?
>>
>>Jeff
>Jeff,
>
>Everyone else has pointed you to data buffering whihc is the VFP way of doing things. In asnwer to your question, the reason your scatter code is not working propely for you has to do with the scoping of the variables. Variables are private when created by scatter and private memvars go away as soon as the routine that created them ends. If you scatter in the form's Init event, when that event is over and it returns all of the variables disappear from memory.
>
>This is one of the reasons that data buffereing is so much better. With data buffering you turn it on by setting the BufferModeOverride property of each table in the form's data enviornment. The you make you controls bound directly to the fields in the table. because of teh buffering the changes to those controls will not be posted to disk until you issue a TableUpdate() call to tell VFP to post to disk. If you decide that you want to discard the changes you issue a TableRevert() call and that throws the buffered changes away.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement