Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private variables not available in 7.0 in form
Message
From
25/03/2004 06:39:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00889462
Message ID:
00889535
Views:
19
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform