Information générale
Catégorie:
Codage, syntaxe et commandes
PRIVATE is **NOT** a means of converting public variables to local ones.
PRIVATE, as you note, does NOT create a variable, but rather tells VFP to "hide" any such-named variables from the time the PRIVATE statement "executes" until the routine in which it is declared terminates.
This then allows you to create a (new) variable with the same name that can/will be used both in the routine and in any functions or procedures called from that routine INCLUDING any that called routines may call.
Hope this helps
>Can someone give me a simple but clear understanding of the difference between LOCAL and PRIVATE? I've read the docs but they leave me unsatisfied. I understand that LOCAL actually creates a variable whereas PRIVATE does not. So is PRIVATE just a means to convert a public variable into a local one?
>
>Also LPARAMETERS vs PARAMETERS? One is LOCAL and the other is PRIVATE? I don't see the difference. Also, aren't variables created as LOCAL or PRIVATE by default without specifying? If so, what's the point?
>
>Thanks for any insights in this.
>
>- Don
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement