Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make undo and redo action in a table?
Message
De
16/02/2006 16:46:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01096632
Message ID:
01096894
Vues:
24
>SCATTER NAME creates object not array, maybe you want :
>scatter TO ThisForm.aNewValues

Of course! How could I overlook that? (Against stupidity...) I had tried to create an array property; with a regular property, SCATTER NAME and GATHER NAME work all right.

Here is some sample code, for Canh:
* Form.Init()
ThisForm.AddProperty("aNewValues")

* TestButton.Click()
wait window "Old value: " + C1
replace C1 with "xyz"
wait window "New value: " + C1
scatter name ThisForm.aNewValues && Undo
TableRevert()
wait window "Old value: " + C1
gather name ThisForm.aNewValues && Redo
wait window "New value: " + C1
The table, which contains a field called C1, was previously opened with buffering = 5.

For the real application, the "Undo" and "Redo" actions would be in different buttons.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform