Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A basic thought about LOCAL variables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00309158
Message ID:
00309298
Vues:
29
>Mike,
>
>Paul Vlad is mistaken. If a variable is released when a routine ends then it is NOT PUBLIC. The only thing that makes a public different than a private is that it outlives its creating routine. If it doesn't outlive the routine then it is either private or local. If it can be seen and manipulated by other routines called from the creating one, then it is private. If it is visible ONLY to the creating routine and not anyother routines anywhere, then it is LOCAL.
>
>Variables in VFP are PRIVATE by default unless they are explicitly declared with some other scoping. There is no "strange beast" related to variables that have not been declared, they are private. They act like private, they look like private, they last like private, they ARE private.

No, not entirely. I believe Paul is correct. A PRIVATE variable will not destroy a varible of the same name created at a higher level. An undeclared variable will alter the contents of a variable of the same name created at a higher level. That is what makes an undeclared variable different from an explicitly declared private one.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform