Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form class and its DataEnvironment
Message
From
15/07/2011 17:52:59
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Form class and its DataEnvironment
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01518316
Message ID:
01518316
Views:
111
Hi,

I have a form (SCX) with no cursor in its DE. (It opens a table in its load() event)
At runtime, when the form's grid control is being instantiated, that is in grid.Init() method, I notice that THISFORM.DataEnvironment is an object, TYPE('THISFORM.DataEnvironment') = 'O'

I then save that SCX as a class frm_PVCT in a classlib HVCFRM.VCX then runs the form as below:
m.oFrm_PVCT = NEWOBJECT('frm_PVCT', 'HVCFRM.VCX')
m.oFrm_PVCT.SHOW(1)
However, in the grid.Init() method, I notice that THISFORM.DataEnvironment is absent.
I know that because a line in my grid.init():
IF NOT EMPTY(THISFORM.DataEnvironment.InitialSelecteAlias) AND ...
triggers VFP error# 1925, unknown member DATAENVIRONMENT ...

My question are:
1) It is true that, at runtime a SCX always has DataEnvironment established even if it does not has any cursor added to its DE?
2) For a form class, how do I give it an empty DE like that in 1), so that its DE is established early enough to be seen by the form's controls when they are being constructed?
Next
Reply
Map
View

Click here to load this message in the networking platform