Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting results from form created with CREATEOBJECT()
Message
From
08/08/1999 19:50:48
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00251295
Message ID:
00251313
Views:
8
>I've created a form class that basically asks the user to confirm an action by having them type in a given word and clicking OK or pressing enter. I know I can pass a parameter back to the calling form by using DO FORM myForm TO myVariable, but how do I accomplish this using a oMyobject=CREATEOBJECT('myForm') to instantiate? Should I just create a form and use DO FORM for this? Thanks for sharing your experience.
>

If you're operating in a purely modal environment, the DO FORM with a modal form is the easiest way to pass back a value from a form without doing something that's relatively complicated. My preference is to use parameter objects for both input and output - have the caller create an object that holds both inbound parameters and receives results; the object is passed to the Init of the class, and an object reference is saved in a class property. the object can be updated at any point through the object reference, and the object will persist beyond the life of the form. It offers tremendous advantages in that you can use the mechanism to pass back multiple results, and you can examine itnermediate results as needed.

For the situation you outline, it's probably overkill - with a single result coming back and a purely modal behavior expected, DO FORM with a modla form is a cleaner, simpler approach. While perhaps not as elegant, there's something to be said for KISS.

>Marcus.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform