Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between forms and class based forms?
Message
De
02/04/2009 13:51:28
 
 
À
02/04/2009 12:24:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01391221
Message ID:
01392807
Vues:
75
Fabio --

Thanks. I'll keep that in mind. Altho, truth be told, I rarely use that feature.



>>What's the functional difference between a form and a class based form?
>>
>>I have seen code like the following enough times to wonder: Why not Do Form ???
>>
release _oAnchorEditor
>>public _oAnchorEditor
>>_oAnchorEditor = newobject('AnchorEditor', 'AnchorEditor.vcx')
>>if vartype(_oAnchorEditor) = 'O'
>>	_oAnchorEditor.Show()
>>else
>>	release _oAnchorEditor
>>endif vartype(_oAnchorEditor) = 'O'
>>
>>Thanks
>
>One of the most difference is this:
>a form class property it is evaluated the first time only,
>a form scx property it is evaluated every time the scx is created.
>
>
>PUBLIC x,y
>x = CREATEOBJECT("formvcx")
>x.visible = .T.
>CHRSAW(10)
>y = CREATEOBJECT("formvcx") && after 10 seconds y return x.datetime
>y.visible = .T.
>
>DEFINE CLASS formvcx AS form
>
>	opentime = (DATETIME())
>	
>	ADD OBJECT text1 AS textbox WITH ;
>		Alignment = 3, ;
>		Value = (m.THISFORM.opentime), ;
>		Height = 23, ;
>		Left = 36, ;
>		Top = 36, ;
>		Width = 204, ;
>		Name = "Text1"
>
>ENDDEFINE
>
>if you create the same example with a scx, the datetime it is the time when the scx is created.
>
>Result: into a VCX form you cannot to put a dynamic property into the class properties.
>( this is that to do the scx loader )
Jim Nelson
Newbury Park, CA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform