Re: compile a routine wich inlude a commun [message #47108 is a reply to message #47067] |
Tue, 24 January 2006 14:15   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Tue, 24 Jan 2006 22:30:22 +0100, F�LDY Lajos wrote:
> Hi,
>
> and the odd thing is, that functions sometimes return these references,
> not the values:
>
> function f, arg
> return, arg
> end
>
> a=1
> (f(a))=2
> help, a
>
> A INT = 2
>
Interesting. Try:
IDL> (f(a[0]))=2
% Expression must be named variable in this context: <INT ( 2)>.
% Execution halted at: $MAIN$
and you'll see the distinction. Temporary variables can be used for
many things, but direct assignment is not possible. One good use of
temporary variables is subscripting or structure dereferencing them:
IDL> a=(size(b,/DIMENSIONS)[0]
JD
|
|
|