comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » using Make_Array in Execute() call
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
using Make_Array in Execute() call [message #4749] Fri, 14 July 1995 00:00
Martha-Kusterer-S1C is currently offline  Martha-Kusterer-S1C
Messages: 2
Registered: July 1995
Junior Member
Has anyone had experience with calling Make_Array inside an execute call? I am
currently forced to use IDL 3.5.1 and need to create a variable containing a
variable number of variable sized arrays for which the sizes are not known
until run time. I decided to create a structure with a variable number of tags,
each of which references a different sized 2-d array. I decided to create the
tags using a string and the execute call. I got the call to work when the
routines are compiled and run normally, but when I create *.sav file of the
compiled routines and try to restore it later, it doesn't work. I will someday
update to IDL 4.0 and I will change the code to use handles but that option is
not yet open to me.

I have included an example program of how I am creating the structure. I get
the feeling that I am doing something illegal in IDL by dynamically creating
variables using execute but I thought by calling Make_Array it would be ok.

pro arr,varname,typearr

varname = 'plt_data'
typearr = ',/float'
ntraces = [14,14,7,3,3]
npts = [100,100,40,40,40]
npanels = 5


ending = strarr(npanels)
ending(*) = '),'
ending(npanels-1) = ')}'
t = 'temp'

arrstr = varname+'={'
for n=0,npanels-1 do begin
num = strtrim(string(n,format="(I2)"),2)
ttra = strtrim(string(ntraces(n),format="(I3)"),2)
tn = strtrim(string(npts(n),format="(I8)"),2)

arrstr = arrstr+'P'+num+':'+'make_array('+ttra+','+tn+typearr+ending( n)

endfor

print,'arrstr',arrstr
status = execute(arrstr)
help,plt_data,/struct

print,plt_data.(1)(0,0)

RETURN
eND


--More--(93%)



--


Martha Bolz Kusterer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: POLYSHADE X,Y out of range
Next Topic: IDL memory allocation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:41 PDT 2025

Total time taken to generate the page: 0.00576 seconds