Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can i convert a from to prg with its private DE ?
Message
 
 
À
19/12/2000 05:15:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00454478
Message ID:
00455008
Vues:
37
No it won't. In order to do that, instead of creating a separate variable for the DE, use the form variable and AddObject the DE class to it. When the form is destroyed, the associated object should be destroyed. However, if there is a problem, you may have to explicitly release the DE object in the Destroy of the form to avoid dangling object references.

Form.Load
THISFORM.AddObject("oDE","DE")

Form.Destroy
THISFORM.RemoveObject("oDE")

>Will This behave like the Private DE that as designed in from visual designer.
>That whenever I change the form the DE is seleted.
>
>
>>>>can i convert a from to prg with its private data environment.
>>>>Rajesh
>>>Sure you can.
>>
>>Highly informative! ;-)
>It was lame (appologies):
>Public oForm,oDE
>oForm=createobject('Form')
>oDE=createobject('DE')
>oDE.OpenTables
>select freetable
>messagebox(alias())
>oDE.CloseTables
>
>Define class DE as DataEnvironment
>Add object oFREETABLE as cursor
>oFREETABLE.Alias="freetable"
>oFREETABLE.Cursorsource="c:\data\freetable.dbf"
>Enddef
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform