... >I tried this just now with VFP8, and I can escape to get the original >value regardless of whether I return .F. from the valid or NODEFAULT in >the LostFocus. So in both cases, neither one writes the value to the >controlsource using either technique. ...
Have you checked this with VFP6 or 7? (I haven't - since I properly use the Valid() event as most others do - ha ha).
In many ways the Valid and Lostfocus are redundant. Of course FoxPro didn't always have a .lostfocus() event. So what has probably happened is that MS has been trying to change VFP code syntax to be more like VB/C++/C#, etc. They didn't have a Valid() (probably because they suck at working with data - data is an afterthought to those languages <g>). Regardless, it's pretty much a moot point since folks will use what they're comfortable with (and what causes the least breakage in class code <g>).
By the way, what about the case where 'validation-type' logic of a parent class should still be run, but the final step would still be to not leave the control? It would seem in those cases, the .lostfocus() event with the NODEFAULT option probably wouldn't work. But I'm just guessing. Does NODEFAULT stop all the processing up the inherited hierarchy?
-Charlie
©2003 Charlie Coleman |