>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.