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

Home » Public Forums » archive » REBIN Question
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: rebin question [message #29913 is a reply to message #11091] Fri, 22 March 2002 11:14 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jonathan Joseph (jj21@cornell.edu) writes:

> You could certainly write a function that takes an arbitrary number
> of arguments up to a limit, then use n_params to see how many you
> actually got. It looks like IDL only allows up to 8-dimensional
> arrays (which is a goodly number). I only wrote the 2-d case,
> but the n-d case should be possible.

I'm not sure "arbitrary" is the right word here.
One can write procedures and functions with a "variable"
number of arguments, up to some arbitrary (to RSI)
number of 100 or 200 or whatever it is. But each
variable *must* be defined on the procedure or function
definition line.

In the case of the function under discussion, you
could define 8 arguments (the first would probably
have to be a required argument, and the rest could
be optional). But you will need some kind of CASE
statement to call REBIN correctly:

CASE N_PARAMS() OF
0: Message, 'Whoops> Wrong!"
1: A = REBIN(arg1)
2: A = REBIN(arg1, arg2)
...
ENDCASE

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[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: Re: A little handy date function
Next Topic: Want to get Array(48) instead of Array(1,48)

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

Current Time: Wed Oct 08 16:51:39 PDT 2025

Total time taken to generate the page: 0.00433 seconds