Re: How to know if an object has a certain method ? [message #65452] |
Tue, 03 March 2009 11:58 |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
llo wrote:
> I've an object AA and I want to know if this object has a method named
> METHOD_AA...
>
> I could do something like this:
> if obj_isa(AA,'object_1') then 'the object has the method' $
> else 'the object doesn't has the method'
>
> There is another way to do that ?
>
> Thanks
Try OBJ_HASMETHOD (introduced in IDL 6.4). If you don't have IDL 6.4, I
would suggest that the best way to determine if it has the method is to
call it (and CATCH the error if it doesn't).
Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
|
|
|
|
Re: How to know if an object has a certain method ? [message #65456 is a reply to message #65455] |
Tue, 03 March 2009 10:27  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
llo wrote:
> I've an object AA and I want to know if this object has a method named
> METHOD_AA...
>
> I could do something like this:
> if obj_isa(AA,'object_1') then 'the object has the method' $
> else 'the object doesn't has the method'
>
> There is another way to do that ?
>
> Thanks
You could just look in the object__define.pro file....
I guess you are more interested in saved objects. You can call help,
then parse the output for object::method
Jean
|
|
|