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:
00310164
Vues:
43
>Some refinements:
>
>(1) Variables are not in scope under their original name if passed by reference. This includes PUBLICs. PUBLICs and PRIVATEs passed by reference as LPARAMETERS are completely invisible to processes called by the block of code containing the LPARAMETER declaration. This can lead to much head-scratching where different instances of objects have different scopes. Bottom line - don't pass PRIVATEs or PUBLICs where they might be expected to be seen with their original name.

You are correct except it is their visibility that is affected not the scope. The vars still exist, they are simply not visible. I was trying to explain the difference between visibility and scope. Scope is the lifetime of a var while visibility is teh ability for it to be affected by code.

>(2) Variables go out-of-scope if a called procedure explicitly declares the same name as PRIVATE or LOCAL, or if the name is declared in a called procedure as PARAMETERS or LPARAMETERS.

No, they go out of sight (visibility) not out of scope. That is they still exist, but are not addressable.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform