using of EXECUTE??? [message #7370] |
Fri, 08 November 1996 00:00  |
alpha
Messages: 49 Registered: September 1996
|
Member |
|
|
Hello,
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?
Hendrik
--
Panther in the Jungle __..--''``\--....___ _..,_
-BELIEVE AND DECEIVE- _.-' .-/"; ` ``<._ ``-+'~=.
http://www.ang-physik _.-' _..--.'_ \ `(^) )
.uni-kiel.de/~hendrik ((..-' (< _ ;_..__ ; `'
|
|
|
Re: using of EXECUTE??? [message #7409 is a reply to message #7370] |
Wed, 13 November 1996 00:00  |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Hendrik Roepcke wrote:
>
> ok! I understand your points, but imagine you have 500 Arrays (more than 420!)
> with variable sizes and 500 descirbing structures with variable tags with
> in these structures, how you would organize them with IDL in your machine???
>
Personally, I think I'd just shoot myself and put myself out of
my misery. :P
When that didnt work, I'd probably use either an array of handles
to structures that contained the data and describing structures as
members, OR i'd use a tree of handle values instead of an array. It
would depend on how I needed to be able to access the various data,
and how they were related to each other.
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|
Re: using of EXECUTE??? [message #7421 is a reply to message #7370] |
Tue, 12 November 1996 00:00  |
alpha
Messages: 49 Registered: September 1996
|
Member |
|
|
Christian Soeller <csoelle@sghms.ac.uk> writes:
> Peter Mason <peterm@demsyd.syd.dem.csiro.au> writes:
>> 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.
> I strongly support Peter's comment. It is not clear to me what you really
> gain by doing variable creation like this. The approach somehow seems to
> be inspired by a C-like malloc idea which doesn't sound like such a great
> idea within IDL. So I am still waiting for the great example which demonstrates
> the big advantage of doing a findgen via execute?
ok! I understand your points, but imagine you have 500 Arrays (more than 420!)
with variable sizes and 500 descirbing structures with variable tags with
in these structures, how you would organize them with IDL in your machine???
OK! I know, I will have to write 4 routines:
a) Load from Disk to SOME_VARNAME
b) save to disk from SOME_VARNAME
c) get values from SOME_VARNAME
d) put values to SOME_VARNAME
ad and bc will be similar....
cd i want to manage as functions...
ab as procedures
ok, but the problem is discussed sufficant for me now.. or is there something
with ROUTINE_NAME and some undocumented KEYWORDS like FETCH or VARIABLE or ???
that could be useful?
thanks a lot up to here! without internet it cost me a lot of days i estimate!
Hendrik
--
Panther in the Jungle __..--''``\--....___ _..,_
-BELIEVE AND DECEIVE- _.-' .-/"; ` ``<._ ``-+'~=.
http://www.ang-physik _.-' _..--.'_ \ `(^) )
.uni-kiel.de/~hendrik ((..-' (< _ ;_..__ ; `'
|
|
|
Re: using of EXECUTE??? [message #7422 is a reply to message #7370] |
Tue, 12 November 1996 00:00  |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
Peter Mason (peterm@demsyd.syd.dem.csiro.au) wrote:
: 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.)
It works a couple of times, maybe, then fails. Causing gnashing of
teeth, because your simple test program runs, but the real thing won't.
Peter
|
|
|
Re: using of EXECUTE??? [message #7436 is a reply to message #7370] |
Tue, 12 November 1996 00:00  |
Christian Soeller
Messages: 46 Registered: August 1996
|
Member |
|
|
Peter Mason <peterm@demsyd.syd.dem.csiro.au> writes:
> 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.
I strongly support Peter's comment. It is not clear to me what you really
gain by doing variable creation like this. The approach somehow seems to
be inspired by a C-like malloc idea which doesn't sound like such a great
idea within IDL. So I am still waiting for the great example which demonstrates
the big advantage of doing a findgen via execute?
Regards,
Christian
------------------------------------------------------------ --------
Christian Soeller mailto: csoelle@sghms.ac.uk
St. Georges Hospital Medical School Dept. of Pharmacology
Cranmer Terrace London SW17 0RE
|
|
|