Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to put the code?
Message
De
21/08/1998 20:08:40
 
 
À
21/08/1998 15:02:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00128883
Message ID:
00128965
Vues:
23
>Let's say I have a form that has a 'Save' button.
>
>What is the proper or most prefered place to store
>the code associated with this action? I have come
>up with three possibilities and in the most intuitive,
>but perhaps not most optimal order:
>
>1. cmdsave.click() - self contained and easy to find
>
>2. thisform.save() or this.parent.save()- almost as easy
> to get to the code, and can be called from the button,
> menu or toolbar.
>
>3. object.savemethod() - most obscure and least familiar
> to me
>
>Does any of this change if I couple the save button with
>add, next, prev into a container?
>
>Your thoughts on this matter will be appreciated.

Mine is kinda spread out. But, most of the code is in the form. Here's what I have in the Save button:

WITH ThisForm
IF .BeforeSave()
IF .Save()
.AfterSave()
ENDIF
ENDIF
ENDWITH

Only the Save has generic code. The BeforeSave and AfterSave can be customized for each form.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform