|
Re: Returning > 1 variable with functions? [message #37454 is a reply to message #37450] |
Wed, 17 December 2003 01:56  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Jonathan Greenberg wrote:
> Is there any way to write and call a function that returns more than one
> variable? The variables are arrays of different sizes, so merging them into
> a single array is an ugly way of doing it... help!
>
> --j
>
>
Why not returning a structure, or a pointer
return, {x:1,y:2,z:3}
ptr=ptr_new({x:1,y:2,z:3})
return, ptr
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|
|
Re: Returning > 1 variable with functions? [message #37457 is a reply to message #37455] |
Tue, 16 December 2003 18:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jonathan Greenberg writes:
> Is there any way to write and call a function that returns more than one
> variable? The variables are arrays of different sizes, so merging them into
> a single array is an ugly way of doing it... help!
I'd return them in keywords. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|