[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Array structure--in a structure





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.html



regards 

Reimar