Home »
Public Forums »
archive »
Re: Determine if class has method/property
Re: Determine if class has method/property [message #44423] |
Mon, 13 June 2005 23:19 |
Antonio Santiago
Messages: 201 Registered: February 2004
|
Senior Member |
|
|
Michael Wallace wrote:
> Is is possible to dynamically determine if a given class has a certain
> method defined? Similarly, is it possible to determine if a class has a
> certain property defined?
>
> I'm attempting to be a good programmer and validate some of my input and
> displaying nice error message rather than just handing it off to IDL and
> letting IDL return a nice cryptic (at times) message. It turns out that
> my code is filling up with a bunch of OBJ_ISA statements because I have
> to check each class that could be used. While these classes all have
> the same methods defined, those methods are not present in their
> superclass, so I can't just do a simple check to see if a given class is
> an instance of the superclass. I can't change the superclass so my
> options are either to write my own specific OBJ_ISA functions that do
> all the checking for me or determine if the class in question has a
> certain method defined before I try to use it. I'm just wondering if
> the latter is possible before I go off writing my specific versions of
> OBJ_ISA.
>
> -Mike
Hi Michael,
It seems it is your luky day :). See at RSI user contrib site here
http://www.rsinc.com/codebank/search.asp?search=category& ;product=IDL&catid=31.
JP has a bunch of useful routines for that. Also there is my beautiful
EventAction class :)
Bye.
--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
|
|
|
Current Time: Sun Oct 12 04:27:46 PDT 2025
Total time taken to generate the page: 0.80127 seconds