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

Home » Public Forums » archive » Re: keyword params in HISTOGRAM
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: keyword params in HISTOGRAM [message #7540] Thu, 21 November 1996 00:00
chs11 is currently offline  chs11
Messages: 14
Registered: October 1995
Junior Member
In article <329392F4.1A80@shapley.colorado.edu>,
Mark Fardal <fardal@shapley.colorado.edu> wrote:
> However, when I try to pass HISTOGRAM a keyword parameter that's
> undefined, I get an error message. The routine here is just a
> wrapper function for HISTOGRAM, so I want to pass a number of
> keyword parameters through to it.
>
> function histomake, array, binsize=binsize, xpoints=xpoints, $
> input=input, min=min, max=max, omin=omin, omax=omax, reverse=reverse
> [...stuff deleted...]
>
> n = histogram(array, binsize=binsize, min=min, max=max, $
> omin=omin, omax=omax, reverse=reverse)
>
> [...stuff deleted...]
> return
> end

This doesn't work because you can't assign an undefined variable
to a new variable name. It has little to do with the function call
but is as simple as the following eroneous code:
IDL> a = b ; where b is undefined!

Anyhow, the solution to your problem is the use the _EXTRA keyword.
_EXTRA is a structure that contains all keywords that are not
explicitly defined in a procedure definition. You use it as follows:

function histomake, array, _EXTRA = EX
n = histogram(array, _EXTRA = EX )
return
end

IDL> a =histomake(b,max=23)
Here, the max parameter is not recognized by histomake, so it sends it
on to histogram.

Hope this helps.

Carl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Question on: IDL link with External C program
Next Topic: IDL Logical Unit question: ever seen this?

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

Current Time: Wed Oct 08 13:45:37 PDT 2025

Total time taken to generate the page: 0.00548 seconds