ToBeReviewed/STRUCTURE/
mixstru.pro
Concatenate 2 structures together.
The difference with CREATE_STRUCT
is that if the 2 structures have same elements's name, then mixstru
do not break down but choose for the common element the value
specified by the first structure.
mixstru
Structure
result = mixstru(stru1, stru2)
Return value
A structure
Parameters
stru1
in
required
Structure which can have same elements's name than
STRU2 but with a different value.
stru2
in
required
Structure which can have same elements's name than
STRU1 but with a different value.
Examples
IDL> a=get_extra(/toto,ok=123)
IDL> b=get_extra(ok=111, year=1999, age_capitaine=35)
IDL> help, a,b,/struct
** Structure <8334424>, 2 tags, length=4, refs=1:
OK INT 123
TOTO INT 1
** Structure <8373da4>, 3 tags, length=6, refs=1:
AGE_CAPITAINE INT 35
OK INT 111
YEAR INT 1999
IDL> help, mixstru(a,b),/struct
** Structure <82f25ac>, 4 tags, length=8, refs=1:
AGE_CAPITAINE INT 35
YEAR INT 1999
OK INT 123
TOTO INT 1
IDL> help, mixstru(b,a),/struct
** Structure <834604c>, 4 tags, length=8, refs=1:
TOTO INT 1
AGE_CAPITAINE INT 35
OK INT 111
YEAR INT 1999
Version history
Version
$Id: mixstru.pro 375 2008-08-08 15:55:40Z pinsard $
History
Sebastien Masson (smasson@lodyc.jussieu.fr)
7/10/1999
Known issues
Restrictions
If STRU1 or STRU2 are not structure, mixstru send back -1
Produced by IDLdoc 2.0.