Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a createobject('modalformclass')
Message
From
30/08/2000 11:00:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Returning a value from a createobject('modalformclass')
Miscellaneous
Thread ID:
00410770
Message ID:
00410770
Views:
40
I know that this is going to sound simple, but I've fallen into the convienence of the form designer and DO FORM and now I'm trying to get out into the OOP world...

Normally, I create all my forms with the form designer and issue a DO FORM frmName WITH param1, param2 TO cVar in order to return a value to a method of another form. Now I'm trying to do the same with a custom modal form class I've created. I can pass values to the class without any problem, but how do I return a value back to the calling method? I have a RETURN cVar in the class' Unload() event, but what needs to be in the calling form's method to 'catch' the value unloaded?

*** From a custom method in Form A
cVar = ''
loFrmRV=CREATEOBJECT('frmReturnVal','frmRV',cVar,'param1','param2')

*** In the class' init()
PARAMATERS lcFrmName, lcReturnVal, lcFrmCaption, lcLblMessage
This.cReturnVal = lcReturnVal
...

a value is selected in a cbo, then in the Unload() I try to RETURN This.cReturnVal, but the value doesn't come back to the original form. I've even tried to pass @cVar with no luck. I'm sure there is a basic concept here that I'm misunderstanding...

I'm trying to avoid PUBLIC var's since I've read so much that, for whatever reason, they should be avoided.

Thanks for your help with this,
- Brian


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Next
Reply
Map
View

Click here to load this message in the networking platform