Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus in VALID sometimes works!?
Message
From
05/06/2001 18:40:02
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00514105
Message ID:
00515475
Views:
14
>>The VFP doc says that one cannot SETFOCUS in a VALID, RANGE-HIGH/LOW, etc. And yet, I have a form where I accidentally did this and Lo! it works most of the time, but fires an error "cannot setfocus in valid, ..." some of the time. I actually stepped through the code in VALID and watched it pass right over the SETFOCUS.
>
>Arne;
>
>What you will find is that it will continue to behave as you described and then one fine day (no day in particular), it will quit working! I have seen this occur and trust that setfocus and valid (etc.) do not mix. This type of behavior is something I call a “soft failure”. Sometimes code will work (that should not) and some time down the road it will come back to bite you.
>
>Never deliver code of this type to a client or you may end up working at McDonald's in a new career field.
>
>Tom

Tom,

Lordy! I would never! Seriously though, this was just an instance that slipped through debugging. I think it made it in there because I moved the code from another method and was sloppy in checking. Usually this is not a prob 'cause VFP would error and then the thing gets fixed. In this case, it managed to get through (except once!) even though that code was executed many times. Just annoying is all...

Peter suggested that the problem might be with the event reading being 'off' but this is definitely not the case here.

-Arne
arne@synercom-edi.com "There are no absolutes but this one."
President, synercom/edi - Event Ticketing Solutions
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform