Message
 
General information
Fórum:
Visual FoxPro
Category:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
ID da thread:
01450463
ID da mensagem:
01450471
Views:
37
>>>Hi,
>>>
>>>I dropped an object (class) on a form. Then in the form LOAD method I check if this object is NULL as following:
>>>
>>>isnull( thisform.MyObject )     && Returns .F.
>>>type( "thisform.MyObject" )   &&  Returns "O"
>>>
>>>
>>>So I presumed that the object is instantiated in the LOAD method of the form. But when I call a method of this object in LOAD method of the form, I get error that the object does not exist. Does it mean that the object is fully instantiated only in the INIT method of the form?
>>
>>Yes
>>
>>But you can add the object in the load() of the form prior to using it
>
>You mean by instantiating the object as the following?
>
>thisform.MyObject = newobj("MyObjectClass","ClassLib")
>
Usually you add objects in Form's Init, though you can add objects this way in Form's Load. I think I added CA objects in Form's Load.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Responder
Mapa
View