Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private vars
Message
 
To
01/06/2001 09:38:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00513736
Message ID:
00516247
Views:
11
>reading a recent post, I read ( then proved ) that if you declear a private var in you main program it will have golbal scope.
>
>WHY!!!?!?!?!

Because you are confusing private with local. xBase has private variables, most other languages do not have private.

Ther are two issues related to scope of a variability, its visibility (can it be read and written) and its lifetime (when is it released automatically).
<strong>Scope         Visibility                            Lifetime</strong>
PUBLIC        In the declaring routine,        From creation unitil it 
              below the declaring routine,     explicitly released or fox 
              and above the declaring          closes
              routine

PRIVATE       In the declaring routine and     From creation until the
              below the declaring routine      declaring routine ends

LOCAL         In the declaring routine ONLY    From creation until the 
                                               declaring routine ends
Hope this helps
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform