Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I _Need_ OKLs!
Message
From
02/07/1999 21:10:54
 
 
To
02/07/1999 19:48:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00237087
Message ID:
00237104
Views:
12
>Erik
>
>Still on the subject of "not using OKLs"
>
>(if not erik
> see last of previous thread "Event Processing Basic Query"
>endif)
>
>Just tried this experiment:
>
>created a form, called "hotkey" as part of a formset - made it 'always on bottom'
>
>put 3 command buttons on it. One such is the F9 button which triggers a routine called "choosego", so I call the button "choosego".
>
>each button has an appropriate click method which takes the form:-
>
>dodefault() && (which I'm hoping is enough to take care of the interprocess problem)
>=choosego && (my hotkey code)
>
>in the load of this form I assign the keys thus
>
>on key label F9 THISFORMSET.HOTKEY.CHOOSEGO.CLICK()
>
>Trouble is, when I run it, and press F9, I get 'object "HOTKEY" not found - even though wexist says its alive and well.
>

You can't use stuff like THIS, THISFORM, and THISFORMSET in an OKL- those keywords only have scope inside an object method, and OKL routines are not methods. I don't use formsets, so I can't help you there, but if it were a form, oyu could call a routine that loops through _SCREEN.Forms looking for your form and call the method that you got from that object reference

ON KEY LABEL F9 DO RunFormMethod

PROCEDURE RunFormMethod
FOR EACH oForm IN _SCREEN.Forms
IF oForm.Name = "MyForm"
oForm.SomeControl.SomeMethod()
ENDIF
ENDFOR

Keep in mind, I still don't approve of the use of OKL here... :-)
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform