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

Home » Public Forums » archive » Re: Named and Anonymous structures ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Named and Anonymous structures ? [message #5113 is a reply to message #5111] Mon, 09 October 1995 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <DG1EBF.FrJ@rivm.nl>, robk@rivm.nl (Rob Koopman) writes:
|>
[snip]
|> struc3 = { made_to_measure_struc,
|> first_array: fltarr(number_of_rows, 10), $ ; dynamic
|> another_arr: intarr(number_of_rows, 25), $ ; arrays
|> };
|>
|> array_of_struc3s = replicate({file_specific_struc},struc2.nmbr_o_records)
|> readu,unit,array_of_struc3s
|> free_lun,unit
|> struc_back_to_main = { pret_a_porter_struc $
|> first: struc1 , $
|> secnd: struc2 , $
|> (3): ...... , $
|> (4): ...... , $
|> fifth: array_of_struc3s , $
|> (6): ...... $
|> };
|> end
|> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
|>
|>
|> But here's my problem. I can make "struc_back_to_main" an anonymous
|> structure, and this allows me to read files with different "nmr_o_records"
|> but as soon as there's a file with a different "number_of_rows" I'm in
|> trouble: "struc3" should then also be anonymous, but unfortunately
|> anonymous structures cannot be part of other anonymous structures
|> as I've just found out after writing several main programs that call
|> this procedure :-(
|> Once this struc_back_to_main is passed to the caller, struc3
|> can be destroyed, as far as I'm concerned, but the only way I've
|> managed to do that, is by exiting the IDL session.
|>
|> Is there another way to destroy named structures?

As far as I can tell (haven't had too much experience with version 4.0),
there's only one solution (other than rewriting your code substantially
with your own storage allocation system):

Use:

dymmy=execute( $
"struc3={made_to_measure_" + trim(number_of_rows) + "," +$
"first_array: fltarr(number_of_rows, 10),"+ $ ; dynamic
"another_arr: intarr(number_of_rows, 25) }" $ ; arrays
)

where trim(N) \equiv strcompress(string(N),/remove_all)

This will give you named structures e.g., "MADE_TO_MEASURE_100"
for storing 100 rows, and "...._200" for storing 200 rows.

Stein Vidar
[Message index]
 
Read Message
Read Message
Previous Topic: Re: X-windows black on white
Next Topic: X-windows black on white

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

Current Time: Fri Oct 10 16:50:17 PDT 2025

Total time taken to generate the page: 1.44158 seconds