Re: using of EXECUTE??? [message #7351] |
Mon, 11 November 1996 00:00  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
On 8 Nov 1996, Hendrik Roepcke wrote:
> some people of this group warned me to use
> the IDL option:
> EXECUTE("???")
> It will mess up the memory-management of IDL
> after a while they estimated...
>
> But this option is wunderfull for dynamical
> management of data-array!!
> EXECUTE(name_of_array+"=findgen("+string(dim_of_array)+") ")
> shall I use execute or not?
> any hints?
I'd recommend using EXECUTE() only when there isn't a reasonably simple
"conventional" way to achieve your goal; e.g., for evaluating expressions
typed in by a user of your program.
The docs point out two issues:
. "Compiling the string (execute's arg) at run-time is inefficient..."
. "Do not use EXECUTE to create new variables inside procedures and
functions... (it will fail)" (Actually, this does seem to work with a
full IDL license. I suspect that it might be crippled under runtime IDL,
though - imagine runtime IDL with this restriction lifted.)
In your example above, the only extra facility that EXECUTE gives you which
you wouldn't get by simply doing SOME_VARNAME=FINDGEN(DIM_OF_ARRAY) is
indirect specification of the array's name. I think that this is really a
disadvantage - your program would always have to go via EXECUTE('some op
referencing name_of_array') to USE this new array, as it would only know the
array's name indirectly.
Peter Mason
|
|
|