Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return a value from a form?
Message
From
01/12/2003 08:59:38
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
01/12/2003 08:53:28
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00854035
Message ID:
00854648
Views:
23
Hi Mike

Another possible solution is to use a parameter object.

You create a custom object. Add all the properties you want to it. You pass it to the form. The form uses the properties of the object like it would use parameters. The form can also update the properties and pass the object back.


>Thanks Cetin.
>
>That did the trick. Everything is working well now. I don't think I'm going to ever use DO FORM ... TO Variable again now that I know about this better way of obtaining a form's properties as return values!
>
>Regards,
>
>Mike
>
>
>
>
>>Oh I forgot to mention that. Enter this in Form.QueryUnload :
>>
>>nodefault
>>this.hide()
>>
>>Cetin
>>
>>>Hi Cetin,
>>>
>>>I've used you code below and it works well except for the case when I close the modal form using the "X" button in the upper right corner of the window. When I do this, oFrm is somehow set to .null. and I can't get to any of its properties.
>>>
>>>Any idea why this is so?
>>>
>>>Regards,
>>>
>>>Mike
>>>
>>>>
>>>>oFrm = createobject('myForm')
>>>>oFrm.Show(1) && I might want to use a modeless as modal
>>>>ldStart = oFrm.txtStartDate.Value && Code continues here when form.hide()s
>>>>oFrm.release()
>>>>release oFrm
>>>>
>>>>do form myForm name oFrm linked && Call a modal form
>>>>ldStart = oFrm.txtStartDate.Value && Code continues here when form.hide()s
>>>>oFrm.release()
>>>>release oFrm
>>>>
>>>>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform