Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursive Remove Directory
Message
De
12/12/1999 21:06:28
 
 
À
10/12/1999 23:49:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00302015
Message ID:
00302547
Vues:
37
>>>Oh. Since they're not local, are they public?
>>
>>No, they are not public. They are a weird kind of animal! They behave as private /public variables for all called func/proc/methods. But they are released as soon as the func where they ar declared is finished.
>>

>How is this different from the behaviour of PRIVATE variables?

Did you try the short code sample from my previous message? It clearly shows the difference.

So, PRIVATE only hides a variable that already exists at a higher level. Here's what happens whenever you use a variable without any declaration:
- The variable name is looked up at any higher level
- If found, the same variable is used. If not found, a new variable is created.
- If a new variable was created, then it released at the end of the proc.

Here's what happens when you use a PRIVATE variable:
- The variable is created and used.
- The same variable is released at the end of the proc.

This means that any used-but-not-declared variable may modify some variable with the same name from a higher level. This may be desired some times, but it's dnagerous and I advise against such use.

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform