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

Home » Public Forums » archive » Re: Object Method validity
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Object Method validity [message #36200 is a reply to message #36190] Tue, 12 August 2003 06:34 Go to previous messageGo to previous message
rmmoss is currently offline  rmmoss
Messages: 12
Registered: August 1995
Junior Member
Mark Hadfield <m.hadfield@niwa.co.nz> wrote in message news:<bh9457$ctm$1@newsreader.mailgate.org>...
> Robert Moss wrote:
>> Is there a way to verify the existance of a particular object method?
>> Something like
>>
>> valid = Method_Valid( theObject, "HopedForMethod" )
>>
>> I guess. I've spent a little while rtfm-ing and googling to no avail.
>
> I believe that the only generally valid approach is to call the method
> and trap any errors with a CATCH statement. This has the advantage(??)
> of actually calling the method and checking that your parameters are
> valid. Something like this (Warning: I haven't checked it and haven't
> generalised it to handled function-type methods)...
>
> catch, err
> if err ne 0 then begin
> valid = 0B
> goto, finished
> endif
> call_method, theObject, 'HopedForMethod', param0
> valid = 1B
> catch, /CANCEL
> finished:
>
> But be aware that if HopedForMethod is not bound to the class that
> theObject belongs to, then IDL will spend a significant amount of time
> searching the path for a file with the name
>
> obj_class(theObject)+'__hopedformethod.pro'


That's what I was afraid of. Oh well, time for another minor feature
request. Thanks for taking the time to answer.

Robert
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Embedding colour IDL syntax in Word
Next Topic: Welcome to ITOOLS....

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

Current Time: Wed Oct 08 17:50:26 PDT 2025

Total time taken to generate the page: 0.00454 seconds