Hi Chuck,
GotFocus/LostFocus is what all the other dumbass Windows Programming languages have. But we have more power, more control since we have WHEN = and VALID. Those additional events make the difference between General = Purpose languages and highly specialized langguages, tailored for their job: = Perfect data-management. And perfect data starts with clean data, with validated data.
Maybe it's clearer this way:
In GotFocus, you just entered the Control, in Lostfocus, you are already = out of the control. WHEN takes precedence before you enter, VALID is fired BEFORE you are ALLOWED to leave.
Another difference between VALID and LOSTFOCUS is very important: As = soon as you leave the VALID, the entered data is accepted as to be validated and = ok, thus the Fieldstate is set (see GETFLDSTATE() for more info) which in = turn means, that the entered data gets written to the table. You can't revert that in Lostfocus!
Another analogy would be, that you compare your object with a = supermarket. The VALID is the Cashregister-Zone. You need to validate each customer = for theft; that's what those antennas are good for. If you would do the validation after the theft left the store (LOSTFOCUS), you're out of = luck, the user is already out of the objects responsibility.
Servus
wOOdy
|\_/| ------ ProLib - programmers liberty --------- (.. ) Unsere MVPs bringen den Fuchs zum Laufen... - / auf www.prolib.de und www.AFPages.de
©2003 Juergen Wondzinski |