Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scoping
Message
From
22/05/2007 06:58:13
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01227514
Message ID:
01227573
Views:
24
>>What level of scoping do I set a variable to in a procedure within a PRG so that it is available throughout the program? Do I have to define them at the program level before any procedures that contain them are called? Hate using PUBLIC if I don't have to.
>
>If you set the variable private it would be visible down in the calling chain.

Actually, that's not correct - as long as a variable isn't LOCAL it will be 'visible' to any called modules.

The purpose of PRIVATE is to hide any *previous* instance of the same variable name, beginning at where the PRIVATE is declared and continuing through any called module. A PRIVATE declaration does not cause the creation of any memory variable.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform