You might also want to test successful instanciation prior to calling any object methods.
ThisForm.MyObject = CreateObkect('MyClass')
if vartype(ThisForm.MyObject) = 'O'
ThisForm.MyObject.visible = .t.
else
Error(xxx)
endif
>>Erik, thanks for your reply MyClass is definately a class. A container class to be exact.
>
>I.e. since it doesn't have a .show method (see Gerry's reply), you show it by setting
>MyObject.visible=.t.
>but it will do you noo good, because MyObject as a variable (reference to your object) is a private or local to the method where you run htis code, so it will go out of scope and get destroyed. You should rather do ThisForm.AddObject({name_here}, {class_here}) to make it addressable as ThisForm.MyObject - it will be there until the form is there, or until you ThisForm.RemoveObject({same_name_here}).
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only