Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public or Private
Message
From
01/10/1997 15:06:27
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
29/09/1997 23:19:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00052342
Message ID:
00052728
Views:
32
>I have been told that any variable in a program (*.prg file) is >private unless declared as public. Is this true? Variables I make >are always declared as private and if the above statement is true >it would save some work making sure every variable is accounted for >and is private. I am working inside someone elses application writing >reports and I want to be sure. > >Andy A variable is private unless it already exists - then it's the caller's private or public variable. Since you can't be sure whether it exists or not (ok, you can test for its existence, but that's overhead), it's easier to declare it private. Once declared private, it's yours, and if an older variable of the same name existed, it's invisible. Once you exit your .prg, the older variable is visible again. The difference between Local and Private is for the routines you call from your .prg (or method, the same) - they will inherit your private vars, but won't know your local vars.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform