General information
Category:
Object Oriented Programming
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only