Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private vars
Message
From
07/06/2001 08:46:23
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00513736
Message ID:
00516255
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


thanks for the table, it helps.

btw, the statement ending "...most other languages do not have private" as not the source of confusion. It's that I'm a trained C and Java programmer working with fox right now and a private var is, well, a private var ( but in fox that seems to be a local ), a protected or local var is a private in fox , and the only standard that MS decided to retain was for public scope. thanks again

- jer
Previous
Reply
Map
View

Click here to load this message in the networking platform