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

Home » Public Forums » archive » Re: Array structure--in a structure
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
Re: Array structure--in a structure [message #22280] Fri, 03 November 2000 02:17
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Marianne wrote:
>
> I want to define a structure containing arrays of structures. Is this
> possible without using pointers?
>
> E.g..
>
> tmp1={AA,a:1,b:2}
> tmp2={BB,CC:AA(12)}
>
> I realize this is not correct code, but what is?
>
> Newbie-ly,
> Marianne

Dear Marianne

In our library are lots of routines for structures and their tags.


; NAME:
; reform_struct
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/reform_struct.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/reform_struct.sav
;
; PURPOSE:
; This function is used to reform a structure as tag array or
; struct array
;
; CATEGORY:
; PROG_TOOLS/STRUCTURES
;
; CALLING SEQUENCE:
; result=reform_struct(structure,dim1,[dim2],[dim3],[dim4],$
; [dim5],[dim6],[dim7],[dim8],[/struct_array],[/tag_array]
;
; EXAMPLE:
; data=create_struct('A',FINDGEN(15),'B',SIN(FINDGEN(15)))
; result=reform_struct(data,15,/struct_array)
; HELP,result
; RESULT STRUCT = -> <Anonymous> Array[15]

tmp={a:findgen(15)}
tmp=reform_struct(tmp,15,/struct_array)
tmp2={a:tmp,b:1}
help,tmp2,/str
** Structure <1353068>, 2 tags, length=64, refs=1:
A STRUCT -> <Anonymous> Array[15]
B INT 1



The following routines are useful for non arrayed structures.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/replace_tagvalue.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/replace_tagvalue.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/add_tag.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/add_tag.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/delete_tag.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/delete_tag.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/rename_tag.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/rename_tag.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/shift_tag.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/shift_tag.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/tag_position.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/tag_position.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/text2tagname.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/text2tagname.sav

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/get_tagname.tar.gz
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/get_tagname.sav


For further routines and copyright and licence.
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml



regards

Reimar
Re: Array structure--in a structure [message #22291 is a reply to message #22280] Thu, 02 November 2000 15:17 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Marianne wrote:
>
> I want to define a structure containing arrays of structures. Is this
> possible without using pointers?
>
> E.g..
>
> tmp1={AA,a:1,b:2}
> tmp2={BB,CC:AA(12)}
>
> I realize this is not correct code, but what is?

tmp2={BB,CC:replicate({AA,a:1,b:2},12)}

then you can do

tmp2.cc.a=findgen(12)

etc. But you'd better hope you don't later want 11 or 13 AA's, because
without pointers, you're stuck.

JD

--
J.D. Smith | WORK: (607) 255-6263
Cornell Dept. of Astronomy | (607) 255-5842
304 Space Sciences Bldg. | FAX: (607) 255-5875
Ithaca, NY 14853 |
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL 5.4 HDF library
Next Topic: Re: MESH_DECIMATE anyone?

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

Current Time: Fri Oct 10 01:20:33 PDT 2025

Total time taken to generate the page: 1.68088 seconds