Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return value from a Form
Message
From
26/07/2011 09:52:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
26/07/2011 00:42:58
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01333380
Message ID:
01519178
Views:
60
>Hi,
>
>How to Hiding a modal form and get the return value to the calling form ?

The form needs to be in a vcx, not scx (maybe not, but easier this way). In the form's unload() or whichever code is called by the close button, set a property of the form, and instead of thisform.release() issue a thisform.hide(). The calling then looks like this:
loFrm=createobject("mymodalformclass")
loFrm.show()

?loFrm.myProperty
release loFrm
IOW, this way the form object reference doesn't go away when you close it - it's just hidden, but alive and accessible. The advantage over returning a value from form.unload() is that you can access multiple properties. In that case, though, you can return multiple values if you package them into properties of an object (a collection, perhaps) and return that object. The way I described here, you don't need to package anything.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform