Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Column Click
Message
De
15/06/2005 20:31:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/06/2005 20:28:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 5.x
Database:
Visual FoxPro
Divers
Thread ID:
01023333
Message ID:
01023760
Vues:
12
>Thanks Hilmar ! I apreciate that, never through on my mind using PendingChanges() and AskToSave()...but now i think i have to use those methods...Thanks a lot
>
>Best regards
>Winarto.

Of course, for code re-use, you should have this kind of methods in your base classes. Let me explain briefly, in case you are not familiar with classes and inheritance.

For example, you can have a form class, which might be called cDataForm, for managing single tables (managing multiple tables is more complicated). Then, derive several forms (list of clients, list of products, etc.) from this class. Any change you do in the class will be reflected in each form. Thus, if you detect an error in your code, you have to fix it in one single place.

But first, try it with a single form, before you convert this form to a class.

Also: Methods like AskToSave() (or some method that checks for pending changes) should be called in a variety of situations, for example, when the user tries to:
  • Close the form.
  • Go to the next record, the previous record, the first or the last record.
  • Select an order - if this sorting sequence goes to the first record according to the selected order.
  • Set a filter, if you have enabled that option.

    Greetings,

    Hilmar.
    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