Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with a .show
Message
From
06/06/2001 08:13:28
 
 
To
05/06/2001 23:42:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00515509
Message ID:
00515641
Views:
8
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
Map
View

Click here to load this message in the networking platform