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 #50635 is a reply to message #50504] Fri, 06 October 2006 06:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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 12:12:18 PDT 2025

Total time taken to generate the page: 1.67563 seconds