Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_vfp.setvar help
Message
From
31/01/2000 11:49:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
_vfp.setvar help
Miscellaneous
Thread ID:
00325066
Message ID:
00325066
Views:
60
I am trying learn how to use the _vfp.setvar() method to create variables on the main vfp application object that can be accessed from any form using the _vfp.eval() method.

I am having trouble understanding the scope of the _vfp.setvar() calls...

If I create the object variable using _vfp.setvar() in my main .prg file (before any forms are called), they seem to be "public", in that any of the forms that might be launched can access the variables using the _vfp.eval() method.

However, if I create a new variable (call it "nEmployee")using _vfp.setvar() from within a form, and then close that form, and open another form, and try _vfp.eval("nEmployee"), it says that variable does not exist.

Basically I want a way to create and set publicly available variables to exchange data between forms. I thought this might be a good way. And it is... as long as you make the _vfp.setvar() call from the main .prg file.

Perhaps someone can teach me a better way to achieve this.
Next
Reply
Map
View

Click here to load this message in the networking platform