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:
00513742
Vues:
14
>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!!!?!?!?!
In VFP a private variable is scoped to the program that created it, and any subsequent program called from within this program. So, if you declare a PRIVATE variable in you main program is the same as declaring it GLOBAL.


>I don't understand why the deviation on something so primitive.
I think is for compatibility with previous versions of xBase languages. First versions of xBase languages only had public and private variables and "private" was the defaul scope.

However, now you can declare your variables as LOCAL and achieve the behavior that you are looking for.
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform