Well ....

Everything was working good last Friday, but this morning ... back to weird
things

Working with the same form built run from a class:
I have a button to quit the form with "thisform.release()" in the click
event.

The code is running but the form will not release ?

What would cause  the form to not release ?

I can click on the X button in the top right cornor and the form will close
So I know the form is not locked

Thanks,
Kent

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Kent Belan
Sent: Thursday, May 30, 2013 10:44 AM
To: 'ProFox Email List'
Subject: RE: Return value from form in class

Hello Ken,

Thanks very much for the quick reply.

I had no idea I could pass parameters like that.

Probably should have looked in the help ...

Thanks also to Richard and Dave.

This is the best resource anywhere ... thanks Ed !!

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Ken Dibble
Sent: Thursday, May 30, 2013 10:14 AM
To: [email protected]
Subject: Re: Return value from form in class


>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 ?

Typically I do something like this (untested and no error-trapping, but
enough to give the gist):

DEFINE CLASS Form1 AS Form
      ModalResult = ""

      PROCEDURE LaunchForm2
           oForm = CREATEOBJECT("Form2",THISFORM)

           oForm.Show(1)

           * Do something with THISFORM.ModalResult here....
      ENDPROC
ENDDEFINE

DEFINE CLASS Form2 AS Form
      ReturnValue = ""
      Caller = .NULL.

      PROCEDURE Init
           LPARAMETERS oCaller

           THIS.Caller = oCaller
      ENDPROC

      PROCEDURE DoSomethingUseful
            THIS.ReturnValue = "Foo"
      ENDPROC

      PROCEDURE UNLOAD
            oCaller.ModalResult = THIS.ReturnValue
      ENDPROC
ENDDEFINE

Ken Dibble
www.stic-cil.org


[excessive quoting removed by server]

_______________________________________________
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