Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass variables from one form to another?
Message
From
07/11/2002 04:37:30
 
 
To
06/11/2002 23:40:44
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00719680
Message ID:
00719710
Views:
17
>Hi all:
>
>Form A declares a set of variables. Click event of a command button fires up another Form B (within Form A). I pick a date, name and a time (displayed as a charcter field), which are assigned to variables. User clicks return on Form B to be returned to Form A.
>
>What is the best way of passing these variables from Form B to Form A?

Nadya mentions one method, to pass a reference to the calling form, update or add properties to it in the called form, and on exit, the updated values are in the form. I prefer to use a parameter object - an object that is used just to move properties between two other objects. It can be passed on call, updated, and the updated values will be visible on return, or, in the case of a modal form, it can be created and populated entirely in the called form, and returned to the caller via the RETURN in the Unload event of the modal form, so that it doesn't affect the content of the parent form directly. It can be a very lightweight object; I expect to use the Empty class in VFP 8 for most of these situations.
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