Re: Zeiger in IDL -> call by reference in IDL [message #4175] |
Mon, 08 May 1995 00:00  |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
Karl Krieger (kak@ipp-garching.mpg.de) wrote:
: css@ipp-garching.mpg.de writes:
: >Weiss jemand, ob in IDL eine Pointeruebergabe moeglich ist,
: >(aehnlich wie in C) ? Ansonsten sind ja staendig riesige
: >Commonbloecke vonnoeten.
: After reading this guys question (if it was possible to pass variables
: by reference in IDL) I read the fine manual on that subject which leads
: me to another question:
: They state that if you pass a variable to a procedure, it is saved in a
: temporary location. When returning from the procedure, the new parameter
: values are copied back into the corresponding variables.
: Does this really mean that IDL allocates new memory for each parameter
: variable even when calling by refernce i.e. passing a pointer?
It says that in the manual, but it isn't true. If you allocate big
arrays till you run out of memory, then try passing that big array to a
subroutine which, say, prints a single element, the call will succeed,
indicating that the array was not copied.
I guess the manual is a convoluted attempt to explain `pass by
reference' to newbies.
Peter
--------------------------------
Peter Webb, HP Labs Medical Dept
E-Mail: peter_webb@hpl.hp.com
Phone: (415) 813-3756
|
|
|