Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A basic thought about LOCAL variables
Message
De
28/12/1999 17:21:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00309158
Message ID:
00309558
Vues:
28
>Privates can be seen outside the routine that creates them but only if that routine is still inthe calling stack. The difference between public and private variables is that publics outliove the creating routine.

Step through this with the trace window while the locals window is open:
release x, y
suspend
do aproc

?y
?x

proc Aproc
	private x
	public y
	x=1
	y=1
endproc
You'll see in the locals that while both are available in AProc, only Y is available to the main prg. This is will AProc is still living. Is that a difference between the two, or am I still reading you wrong?

>Don't confuse the two declaration commands with the scope of the variables.

Good point, my bad

>And ... All variables created without explicitly declaring their scope are private in scope.

OK, I'll believe you. :-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform