Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable defenition
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00354722
Message ID:
00354875
Views:
10
>Hi
>How and where can i declare a variable to be visible any where in my form
>In clipper we use to declare it Private in the top of the main prg
>But how can i do the same in a form I want to declare an array an passe it to a function by reference. the function redimension my array and when it return to my form i want to see my array any where in the form.
>

A Form is an object; a parameter passed to a form would be visible in the Init event of the form. If you want the array to remain present and visible, it needs to be copied to a member array, and then have the member array returned on exit from the form - this can be a complex situation, especially with a non-model form.

An alternative, and IMO, better approach to the solution is to create the array as a member arry of an object whose reference is passed to the form at form creation. The passed reference is saved to a member property of the form. THe array is then referenced through the saved object ref; any changes made are made to the member array of the parameter object, so changes persist beyond the life of the form, and are reflected in the original object whose reference was passed.

>
>Benoit
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