comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Method_valid
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Method_valid [message #40507] Mon, 16 August 2004 11:21 Go to previous message
Andrew Meigs is currently offline  Andrew Meigs
Messages: 8
Registered: November 2000
Junior Member
Is there a way efficiently check if an object has a method? I vaguely
remember this topic coming up in the newsgroup before but my googling has
not been fruitful.

I can of course use the following code to check the existence of a 'copy'
method (a general function is not hard at all as well):

FUNCTION copyCheck, objToCheck
Catch, theError
IF theError NE 0 THEN BEGIN
Catch, /Cancel
RETURN, 0
ENDIF
c = objToCheck -> copy() ;; if ok then goes to next line, if not then
goes to the catch error code
obj_destroy, c ;; don't really want to copy if it's valid. -- 16-08-2004
AGM -- may be inefficient for large objects (surely there's an
method_valid???)
return, 1

END

However, as my code comments suggest if the method actually executes then
there could be large overhead.

Thanks,

Andy
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL implementation of the rolling ball background subtraction algorithm
Next Topic: Re: Interactive dialog_pickfile?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:57:18 PDT 2025

Total time taken to generate the page: 0.39946 seconds