Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to store form related procedures
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00247602
Message ID:
00247692
Views:
20
The problem I'm having is I'm trying to call my procedure from an ON KEY LABEL command.

I've tried putting in the init method: ON KEY LABEL ENTER thisform.mymethod

but it won't let me use any thisform type references from ON KEY LABEL.

I then tried

oThisForm=thisform
ON KEY LABEL ENTER oThisForm.mymethod
And that did not work either...

Any ideas? Thanks!

>>This will show my ignorance, but how do I get the reference to my form (oForm) from within my form?
>
>When you pass thisform as an argument to the function, it passes the form object reference. Anywhere that you would want to use a reference in the format thisform.something, you'd use the parameter that received the object reference (in this case, from Walter's example, where thisform is the third parameter passed, and oForm is the third parameter entry in the procedure, oForm) ie oForm.something
>
>>>
>>>>I have a form with a procedure that needs to be called from multiple places within the same form. If I place the procedure in a procedure file I can no longer make "thisform" type refrences. Where can I store this procedure so that it is considered part of the form?
>>>
>>>Besides of adding a method, You could send a reference to the form along with the functioncall.
>>>
>>>
>>>Like:
>>>
>>>DO myfunction WITH param1, param2, THISFORM
>>>
>>>function MyForm
>>> lparameters param1, param2, oForm
>>> ....
>>> Do some stuff
>>> ....
>>> oForm.refresh()
>>> oform.property = value
>>>return
>>>
>>>Good luck,
>>>
>>>Walter,
Marvin Masson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform