Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defining a global property for an application
Message
From
10/04/2000 22:02:16
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00357663
Message ID:
00357786
Views:
18
> I made the same assumption, but it's not a truly right. I declare a private variable in a main program pcTable and assign pcTable='' (This is important to assign a value, before using a variable). Then I create a form and test, if this variable is still visible. I found, that if I issue Read Events after
>do form MyForm, this variable is still visible in all methods and events, otherwise this variable is visible only for Init and then it becomes out of scope. You can test it.

Read the docs on PRIVATE - it hides prior declarations but does not explicitly create the variable. If this were not the case, please explain how PRIVATE could support wildcarding:

PRIVATE ALL LIKE p*

would have to create an essentially infinite number of variables (at a minimum, 27*(37^128) seems to ring a bell, but clearly a lot more than the maximum value of MVCOUNT.

Look at the difference in how the LOCAL and PRIVATE declarations are defined in the VFP docs - PRIVATE states that it hides previously-instanced variables, while LOCAL explicitly creates variables.
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