Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error using ON KEY LABEL in a From
Message
 
To
14/03/2008 11:12:36
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01301881
Message ID:
01302145
Views:
11
>Why?

Jay,

Here's one reason. ON KEY LABEL is an intercommand interrupt, that is it will iterrupt running code in between commands being executed. The KeyPress event is an event that only gets processed when VFP is in a wait state waiting for user input. Therefore if you need something that will interrupt running code and jump in then OKL is the only thing that will do that for you, however if you are intending to process user input during the normal user input processing then KeyPress is the feature of the language that does that and it is the most appropriate way to accomplish your goal.

It is sort of similar as to why we create LOCAL vars unless there is a specific reason that the var has to scoped more broad than LOCAL. OKLs can be dangerous if they interrupt the wrong code at the wrong time.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform