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:
00309658
Vues:
34
> ...That way ALL undeclared variables would be private, and you must specify that you're referencing a variable created elsewhere, IMO.

So, in this scenario, what is a private variable? You would only have locals adn publics. A private variable is a variable that exists from teh time it is created until it is explicitly released or the routine that created it ends. A private variable is visible to the roputine that creates it and all routines called form that one. So prg1 creates a private variable named lcVar and prg2 has this line in it;

lcVar = "DEF"

what does the assignment line do? It assigns a value to the private variable created above. In fact, declaring a PRIVATE variable does absolutely nothing to the variable you declare, it hides any existing vars with that name. So PRIVATE lcVar does not create a private variable named lcVar, it tells fox to hide any vars that exist with the name lcVar. In fact lcVar won't exist after that until you assign it a value.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform