Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local vs private
Message
De
09/08/2005 19:32:38
 
 
À
09/08/2005 19:17:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01039725
Message ID:
01039728
Vues:
20
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
Fil
Voir

Click here to load this message in the networking platform