On 5/30/2013 10:03 AM, Kent Belan wrote:
Hello,

I am trying to build a form in a class. Everything is working ok, but now
I want to return a value from the form.

How do I get the return value passed back to the calling form ?

Here is my code:

oForm = createobject("testform")
oForm.show(1)
lcReturnMsg = oForm.cReturnMsg

The problem is the 3rd line errors out with oForm not valid because the form
has already released

So what is the trick to return a value from a form in a class ?


Kent,

The others already mentioned the Unload way. I actually sometimes just do a HIDE in the called form and then from the caller I do a release. So for example:

do form frmSomething name loFrm
loFrm.Show()
if loFrm.lOK then
  lcValue = loFrm.cPropertyThatHasValue
endif
loFrm.release()

Just another way. Allows me to handle/grab several values of the called form too instead of dealing with parameter object approach.

hth,
--Mike



--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to