Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do all Valid
Message
De
07/03/1997 06:45:33
 
 
À
07/03/1997 05:35:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00023276
Message ID:
00023278
Vues:
26
>We use Vfp3.0
>Since we don't want to write validation rules on the tables contained in the database.
>We prefer to validate the input on the valid method on the textbox.
>There is a 'Save' button on the form to update record. Can the Save button call all valid methods on the form?

I usually write separate methods for validation. And then a big method to call all them. The valid event of each field calls each one of the small ones.

It looks like this:

TxtName.Valid:
Return ThisForm.ValidTxtName()

Form.ValidateAll:
Local llRetVal

llRetVal = .T.

If llRetVal
llRetVal = This.ValidTxtName()
EndIf
If llRetVal
llRetVal = This.ValidAnyThing()
EndIf

Return llRetVal
* And so on

So in the save button I call:
If ThisForm.ValidateAll()
* Save the data
EndIf
Alexandre Nobre
Alpha Bytes Computer Corp.

Did you know that there are innocent people dying in East Timor?
It helps if you do...

I suppose you don't need glasses if you're able to read this line

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform