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

Re: newbie question / concatenation of arrays of nested structure



Thomas Launey (t_launey@brain.riken.go.jp) writes:

> This question  has probably been already posted many time.
> how can I concatenate 2 arrays of anonymous nested structures?
> In other word, try to concatenate the two arrays below
> 
> first=replicate({a:0,b:'name',c:{d:0,e:0}},5)
> second=replicate({a:0,b:'name',c:{d:0,e:0}},3)
> third=[first,second]
> % Conflicting data structures: B,concatenation.
> % Execution halted at:  $MAIN$
> 
> I have not been able to find a way to do that properly (without subscripting
> each field one after another) an there are no example in David Fanning's
> book (Hey David, I've bought your great book, please help :-))

Not everything is in the book. Sometimes you have to
visit my web page. :-)

   http://www.dfanning.com/tips/concatenate_structs.html

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155