Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form class and its DataEnvironment
Message
De
15/07/2011 17:52:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Form class and its DataEnvironment
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01518316
Message ID:
01518316
Vues:
112
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform