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:
00310222
Vues:
36
>>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.

I think we're using different terminology - they become invisible and unaddressible when subsequent definitions hide them - effectively, they stop existing, which is what I meant by "in scope". You can have several different variables with the same name exisitng in parallel at the same level simultaneously. Neither is visible to the other because neither has a common root to their scope. Are they invisible, or out of scope relative to each other?
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform