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

Home » Public Forums » archive » wrapper functions
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: wrapper functions [message #50623 is a reply to message #50504] Fri, 06 October 2006 12:42 Go to previous messageGo to previous message
Dominic Metzger is currently offline  Dominic Metzger
Messages: 30
Registered: August 2006
Member
Hmmm, well, my problem is that these wrappers should be transparent,
meaning that all the error messages should be the same with or without
the wrapper.

Is this duable?

thanks & best regards,

dometz

David Fanning wrote:
> Dometz writes:
>
>> Wow, I got you guys started on something here... thanks for your input.
>
> We're bored. :-)
>
>> So assuming that READ_PICT would also have some keyword parameters,
>> then I could use REF_EXTRA in the following way... correct?
>>
>> pro READ_PICT_WRAPPER, Filename, Image, R, G, B, _REF_EXTRA=E
>> case (N_PARAMS()) of
>> 5: READ_PICT, Filename, Image, R, G, B, _EXTRA=E
>> 4: READ_PICT, Filename, Image, R, G, _EXTRA=E
>> 3: READ_PICT, Filename, Image, R, _EXTRA=E
>> 2: READ_PICT, Filename, Image, _EXTRA=E
>> else: message, "READ_PICT must have at least two parameters"
>
> You could, but the chance of someone passing an R
> vector without a G and B vector must be within the
> floating underflow error of zero. Why waste time
> coding for things that aren't going to happen? :-)
>
>> For the second option: Could I build an array for { Filename, Image, R,
>> G, B} and pass it in?
>
> No.
>
> If I were coding this wrapper, I would write it like this
>
> FUNCTION READ_PICT_WRAPPER, filename, r, g, b, _REF_EXTRA=extra
> IF N_Elements(filename) EQ 0 THEN Message, 'Must pass a filename.'
> READ_PICT, filename, image, r, g, b, _EXTRA=extra
> RETURN, image
> END
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: .compile_opt strictarr is persistent?
Next Topic: Re: call_procedure with a dynamically created arguments list?

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

Current Time: Sun Oct 12 04:39:40 PDT 2025

Total time taken to generate the page: 1.83868 seconds