>Hi Jim,
>
>This is my last try, then I will be wrong :-)
>
>>There is no way for the calling program to address the private variable...
>
>Ok
>
>>...because before the calling program is back in control the private variable is released from memory.
>
>I would say no. The behavior you decribed is true, but the reason (IMO) is because program above it
just cannot see it even while it is in scope. But PUBLIC variables can be seen. That is a difference between the scope of the two. Using the Locals window this can be seen because it has a combobox that lets you choose which routine you would like to see visible variables for.
>
>Here is a Bitmap with what I think is hard cold evidence of this (it shows the Locals window and Trace window; take not of the value of the combo "Locals for"):
http://208.230.170.137/mgh/jimb.bmp>
>How would you argue against that?
PUBLIC cBlockMyVar
cBlockMyVar = 'Original version'
DO Test1 WITH cBlockMyVar,1
DO Test1 WITH (cBlockMyVar),2
DO Test2 WITH 'Test Value'
? "Main cBlockMyVar =",cBlockMyVar
PROCEDURE TEST1
LPARAMETER cMyVar,iteration
? "t1",iteration, "cMyVar TYPE = "+ TYPE('cMyVar')
? "t1",iteration,"cBlockMyVar TYPE = "+ TYPE('cBlockMyVar')
PROCEDURE Test2
LPARAMETER cBlockMyVar
? "t2 cBlockMyVar =",cBlockMyVar
Run under VFP6 output looks like:
t1 1 cMyVar TYPE = C
t1 1 cBlockMyVar TYPE = U
t1 2 cMyVar TYPE = C
t1 2 cBlockMyVar TYPE = C
t2 cBlockMyVar = Test Value
Main cBlockMyVar = Original version
So PUBLIC ain't always so public...