Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local vs private
Message
From
10/08/2005 09:36:58
 
 
To
09/08/2005 19:54:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01039725
Message ID:
01039846
Views:
21
Look at this example
PROCEDURE One
TheVar = "This is from Proc One"
DO Two
?? TheVar   && Prints "This is from Proc One"

PROCEDURE Two
? TheVar    && Prints "This is from Proc One"
PRIVATE TheVar
TheVar = "This is from Proc Two"
? TheVar    && Prints "This is from Proc Two"
RETURN
So, you can use PRIVATE to hide the previous declaration and reuse the variable name.

FYI, it is considered best practice to use LOCAL variables.


>Thanks Jim -
>If an undeclared variable is PRIVATE by default, what is the point of the command? Can you give me an example?
>
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform