>I am upgrading an application from Version 6.0 to 7.0, and it appears that variables that I set as private before calling a form are not accessable in that form like they were in 6.0. Is this true?
>
>For instance:
>
>On one form I have a button that does the following:
>
> PRIVATE test
> TEST = [123]
> DO FORM foo.scx
>
>I want to be able to access TEST in the form foo. Is there a way to do this without passing it or setting it as a public variable like I could in 6.0?
>
>Aren't private variables available to routines below the calling routine?
They're and still it's the case in VFP7. Possibly you changed something from VFP6 to 7.
As far as m.test stays in scope, it's accesible from within foo. Probably you're checking it later then it goes out of scope :
ie:
PRIVATE test
TEST = [123]
DO FORM foo.scx && Foo is modeless
&& Routine ends here and m.test goes out of scope
PRIVATE test
TEST = [123]
DO FORM foo.scx && Foo is modal
&& m.test is in scope till modal form hides/releases
PRIVATE test
TEST = [123]
Public oFoo
oFoo = CreateObject('myForm')
oFoo.Show()
activate screen
? m.Test
define class myForm as Form
procedure activate
Wait window m.Test nowait
m.Test = 'Hello from foo on '+Transform(Datetime(),'@YL')
endproc
enddefine
Cetin