main logo
Subject: RE: Restrict Textbox Values?
Author: curwiler .at. comcast .DO.T net
Posted: 2003/10/31 09:25:00
 
View Entire Thread
New Search


Well, I guess I should have taken Jerry's warning that this would be a religious discussion. <g>

One thing to note that wOOdy said:
> 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.

I disagree completely. In GotFocus, you can NODEFAULT to prevent entry to the control, while in LostFocus you can NODEFAULT to prevent exit from the control. Just the same as putting RETURN .F. or RETURN 0 in the When or Valid.

Now, this seems to be an important difference:
> 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!

So, I tried it and found that, at least in VFP8, GetFldState shows the change in the Valid, whether buffering was enabled or not. Am I missing something, wOOdy?

This, of course, makes your analogy of the theif leaving the store incorrect. You can still stop the theif, but not with RETURN 0, but instead NODEFAULT.

-Chuck Urwiler, MCSD, MCDBA
http://www.eps-software.com


 
©2003 curwiler AT comcast D.O.T net
<-- Prior Message New Search Next Message -->