I wonder why you have any problem passing around pointer references in IDL. It should not need a COMMON block at all. Notice how this simple pair of IDL routines work together:
FUNCTION return_ptr_data
x = findgen(10) * 2.5
ptrX = ptr_new(x)
return, ptrX
END
PRO return_ptr_data_driver
myptr = return_ptr_data()
print, *myptr
END
I could also write the above this way:
PRO return_ptr_data, myptr
x = findgen(10) * 2.5
myptr = ptr_new(x)
END
PRO return_ptr_data_driver
return_ptr_data, myptr
print, *myptr
END
and passing the pointer through a procedure argument works just as well. Can you see what your code is doing differently that the pointer assignment would fail to pass correctly between two different IDL routines?
|