Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid vs. LostFocus
Message
De
09/04/2003 04:18:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/04/2003 01:52:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00775350
Message ID:
00775370
Vues:
10
>I have seen some interesting code lately where instead of code in the valid method; the programmer is using lost focus.
>
>What are the advantages/disadvantages of such methodology? What is preferred? Why?
>
>Thanks
>
>Ric

Ric,
IMHO FWIW use lostfocus instead of valid wherever possible.
With valid :
-You're still in the object being validated. That means any code called to move context to another object would be an headache sooner or later (ie: if custID is wrong and you popup another form to get ID)
-No code (either directly in valid or any code called from there) could have a setfocus in it.
-Valid in a grid doesn't mean it'd work all the time - based on version
-Messages are controlled mostly by system not you.

With lostfocus :
-You have control either to stay in control or not
-You can freely call other objects such as forms
-You can setfocus
-You decide about messages

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform