Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Parameter
Message
From
04/12/2001 07:33:41
 
 
To
03/12/2001 19:35:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00589020
Message ID:
00589141
Views:
24
>I'm passing a parameter to a form.
>How can I modify and return my parameter to my calling form without declaring a public variable.

In short, you can't - the scoping of the parameter is to the Init event where it is absorbed, so it goes out of scope when the Init event terminates. You'd have to save the value to a form property, and then return it modally on formtermination, and use the TO clause of DO FORM.

A more practical solution would be to pass a parameter object. No it's an object; you save the object ref to a form property. You manipulate the form property within the form, but since it's only a reference, the member properties of the original object passed are actually altered at all times, and the resulting value of the content of the parameter object on termination of the form is the net effect of changes made to properties of the form member property reference.

BTW, the object ref is passed by value, not by reference, so you don't have to rely on the UDFPARM behavior associated with DO, and can pass the reference to a Form created by CREATEOBJ()/NEWOBJECT().

>
>
>thanks
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
Reply
Map
View

Click here to load this message in the networking platform