Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OKL Passing Parameters
Message
From
25/06/2001 16:13:54
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00523099
Message ID:
00523236
Views:
16
>>>I think it was me not getting yours :)
>>>
>>>THIS won't work with OKL, however if you change your strategy a bit, you can get it to work... try using the KeyPress event.
>>>
>>>Something like:
>>>
>>>
>>>object.KeyPress
>>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>>
>>>IF nKeyCode = 28
>>>  NODEFAULT
>>>  DO HelpForm WITH THIS.Name, THIS.PARENT...
>>>ENDIF
>>>
>>>
>>>You might want to just pass THIS to the HelpForm - it saves a bit of rework if you later decide to change which properties of THIS you look at.
>>
>>Hmmm... So, if I pass THIS, all the properties of the object will be available in the called form? I will still need to have code in the KeyPress of any relevant classes though... No way around it, eh? I was hoping that I could keep from having to maintain new classes and just have it work automatically for everything... :(
>>
>Another possibility:
>
>
>OKL F1 DO ShowHelp
>
>ShowHelp:
>
>IF VARTYPE(_SCREEN.ACTIVEFORM.ACTIVECONTROL) = "O"
>  DO HelpForm WITH _SCREEN.ACTIVEFORM.ACTIVECONTROL
>ENDIF
>
>
>I guess this is probably easier... I just like to try to stick with OO :)

Brien,

Sorry, I took away your stars (for the moment); I didn't want anyone to be confused about which way they should go for this issue. I found a couple previous threads about using OKL vs OOP and I like your earlier suggestion better. Trap it in the KeyPress and pass the ActiveControl. I decided to set the main form's KeyPreview to True and use the KeyPress in the form. The problem I'm having is that the ActiveControl is never an object. It always generates an error. Does it make a difference that the object that is (in my mind) current is on a Page on a PageFrame? ActiveForm is fine and when I look at in the Debugger, the ActiveControl has the, "Expression could not be evaluated." listed. Any ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform