Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private vars
Message
 
À
01/06/2001 09:38:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00513736
Message ID:
00516247
Vues:
12
>reading a recent post, I read ( then proved ) that if you declear a private var in you main program it will have golbal scope.
>
>WHY!!!?!?!?!

Because you are confusing private with local. xBase has private variables, most other languages do not have private.

Ther are two issues related to scope of a variability, its visibility (can it be read and written) and its lifetime (when is it released automatically).
<strong>Scope         Visibility                            Lifetime</strong>
PUBLIC        In the declaring routine,        From creation unitil it 
              below the declaring routine,     explicitly released or fox 
              and above the declaring          closes
              routine

PRIVATE       In the declaring routine and     From creation until the
              below the declaring routine      declaring routine ends

LOCAL         In the declaring routine ONLY    From creation until the 
                                               declaring routine ends
Hope this helps
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform