[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing optional parameters through a wrapper routine
- Subject: Re: Passing optional parameters through a wrapper routine
- From: "Liam Gumley" <Liam.Gumley(at)ssec.wisc.edu>
- Date: Tue, 8 Feb 2000 17:16:30 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: University of Wisconsin, Madison
- References: <bowman-0802001505360001@bowman.tamu.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:18346
Kenneth P. Bowman <bowman@null.edu> wrote in message
bowman-0802001505360001@bowman.tamu.edu">news:bowman-0802001505360001@bowman.tamu.edu...
> The _EXTRA keyword handles passing keyword parameters through a wrapper
> routine, but what about optional parameters? If my wrapper for TVRD has
> one of my own (mandatory) parameters, do I have to do the following?
>
> PRO TVRD_WRAPPER, my_arg, x0, y0, nx, ny, channel, _EXTRA = tvrd_keywords
>
> CASE N_PARAMS() OF
> 1 : image = TVRD( _EXTRA = tvrd_keywords)
> 2 : image = TVRD(x0, _EXTRA = tvrd_keywords)
> 3 : image = TVRD(x0, y0, _EXTRA = tvrd_keywords)
> 4 : image = TVRD(x0, y0, nx, _EXTRA = tvrd_keywords)
> 5 : image = TVRD(x0, y0, nx, _EXTRA = tvrd_keywords)
> 6 : image = TVRD(x0, y0, nx, ny, channel, _EXTRA = tvrd_keywords)
> ELSE : MESSAGE, 'Incorrect number of arguments.'
> ENDCASE
> ...
>
> If I just try to pass undefined arguments through my wrapper, I get
> 'undefined variable' errors. (Is TVRD just counting the number of passed
> parameters and not checking to see if they are defined?)
Ken,
In cases like this I usually cross my arms, put my feet up on the desk, look
a person in the eye, and ask:
"How about telling me what the problem is?"
In other words, I'd like to know why you're writing a wrapper for TVRD. I've
done it myself for a number of reasons...
Cheers,
Liam.