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

Home » Public Forums » archive » Passing Data Through CALL_EXTERNAL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Passing Data Through CALL_EXTERNAL [message #3818] Fri, 17 March 1995 12:59 Go to previous message
djk is currently offline  djk
Messages: 2
Registered: March 1995
Junior Member
I'm having problems passing a 2-D array to a C routine using IDL's
CALL_EXTERNAL procedure. Everything works fine passing scalars and 1-D
arrays but when I pass a 2 dimensional float array, I can not seem to
find the data in the second row of the array. I wrote some test code:

TEST.PRO:
nx = long(2) & ny = long(2)
arr = findgen(nx,ny)
a = call_external('test.so', '_test', arr, nx, ny)
end


TEST.C:
long junk(argc, argv)
int argc;
void *argv[];
{
long *nx,
*ny;

float **arr;

/* Assign passed in arguments */
arr = (float **) argv[0]; /* array */
nx = (long *) argv[1]; /* X dimensions of array */
ny = (long *) argv[2]; /* Y dimensions of array */

printf("Arr[][]...); /* prints: 0, 1, 0, 0 */
}

Unfortunately the IDL documentation does not address 2-D array.
I'm using IDL version 3.6.1 on Sun OS 4.1.3.
Any suggestions as to what I am doing wrong? Thanks,

--

( .
(. ) )
) ( ( David Kendig (Hughes STX)
.________. Operations Manager EGRET/Gamma Ray Observatory
| | __| Code 664, GSFC/NASA
| )) Greenbelt, MD 20771
| | //| (301) 286-7242
`---`-`------'---'
Coffee coffee ... djk@egretop.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Reading USGS DEMs
Next Topic: IDL Ignoring CTRL-C under SunOS

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

Current Time: Fri Oct 10 10:21:23 PDT 2025

Total time taken to generate the page: 1.03916 seconds