|
Re: Two named structures with the same name that won't concatenate. Any suggestions? [message #62266 is a reply to message #62175] |
Fri, 29 August 2008 08:45  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On Aug 29, 1:26 am, "J. Solbrig" <JSolb...@gmail.com> wrote:
> I have solved my problem, but am still unsure why my method worked
> many, many times, then decided to quit working. I would really like
> to know so I don't so either I don't do something dumb again, or I can
> avoid a subtle little problem I haven't thought of yet.
>
> Thanks
Hi,
I think the issue may be a little clouded by the fact that your
example is with named structures. It really isn't an issue about
structures but about arrays of any type. Here's a simplifed example
of what you tried above...
SeaDAS> x = {XSTRUCT, A: 0, B: 'boo'}
SeaDAS> a = REPLICATE(x, 70)
SeaDAS> b = [[a],[x]]
% Unable to concatenate variables because the dimensions do not agree:
X.
% Execution halted at: $MAIN$
SeaDAS> help, [a,x]
<Expression> STRUCT = -> XSTRUCT Array[71]
SeaDAS> help, [[a],[a]]
<Expression> STRUCT = -> XSTRUCT Array[70, 2]
The form of concatenation that looks like [[a],[b]] tries to create
an new array with a second dimension. The form of concatenation that
looks like [a,b] simply appends b to a (which what I think you want).
Cheers,
Ben
|
|
|