Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check variables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00930854
Message ID:
00931562
Views:
32
George,

The PUBLIC and LOCAL statements declare variables and initialize them to .F.
The PRIVATE statement doesn't declare a variable at all but hides any variables with the same name if they exist up to the caling chain. The following code demonstrates that
PRIVATE lcVar
? lcVar     && Error: Variable not found
LOCAL lcVar
? lcVar     && No Error>
>
>By default any variables declared as PRIVATE or LOCAL are initialized to .F.
>
>What I do is to add the variables to a LOCAL statement as I first access or assign them.
>
>This is really a problem with testing. If you properly test the code, then these issues go away.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform