Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid vs. LostFocus
Message
From
09/04/2003 04:18:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
09/04/2003 01:52:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00775350
Message ID:
00775370
Views:
11
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform