Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters
Message
From
10/11/2000 21:23:49
 
 
To
10/11/2000 18:09:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00440572
Message ID:
00440650
Views:
10
>Hi,
>
>I want to pass three parameters from one form to another form and expect one value to be returned to the caller form.
>
>In the command button on form1 I have the following code.
>
>PUBLIC cValue
>
>cValue = ""
>DO FORM c:\temp\form2.scx with "abc", "123", cValue
>This.parent.text1.value = cValue
>
>
>In the init() of form2 I have the following.
>Lparameter pass1, pass2, pass3

There's no need to create a PUBLIC; a Form property would work fine, which you'd reference as thisform.rtnvalue as needed in the Form. That's the scope of existance you want to preserve. The reference to pass3 disappears at the end of the Init.

>PUBLIC rtnVal
>
>In the OK command button of the form2 I have the following..
>rtnValue = "TEST"
>ThisForm.release
>
>In the Unload event of form2 I have..
>RETURN rtnValue
>
>After I ran it, I expect cValue to return "TEST" instead of "". What am I doing wrong?
>

Change the DO FORM to:

DO FORM c:\temp\form2.scx with "abc", "123" TO cValue

so that cValue receives the return from the Form. Obviously, Form2 must be modal. Even though the parameter passes by ref, it doesn't survive beyond the Init, so any assumptions about the value of the parameters are invalid after the Init method completes.
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