Re: passing pointers to CALL_EXTERNAL [message #11311] |
Wed, 25 March 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
hdsfkj wrote:
>
> Hi Again,
>
> Is there a way to return a pointer to an array of bytes from
> CALL_EXTERNAL? My C routine
> creates the array and fills it with values. I would like to just pass a
> pointer to the array back to
> IDL. I found an old post with dejanews that suggests it isn't possible.
> I'm trying to avoid the
> performance cost that goes with creating an array in IDL, passing a
> reference to it to the C routine, and copying the previously created C
> array to the IDL array. Thanks for any help...
>
> Donald Green
> dfg@ai.mit.edu
Unless things have changed drastically the last time I looked at
the docs for CALL_EXTERNAL, you must define the array before
passing it to the C routine. An array in IDL is much more complex
than an array in C; I suppose this would be possible if you
knew a lot about the internal structure of variables in IDL, but
I would just create the array first!
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|