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

Home » Public Forums » archive » Re: When you can't concatenate structures like you expect....
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: When you can't concatenate structures like you expect.... [message #15529 is a reply to message #15521] Sat, 22 May 1999 00:00 Go to previous messageGo to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <3745B3BB.815FDE87@ssec.wisc.edu>, Paul van Delst
<paul.vandelst@ssec.wisc.edu> wrote:

As Pavel pointed out in another post, anonymous structures have a "hidden"
name that must match in order to be able to concatenate. The trick is to
copy your original structure and update the fields, rather than creating a
new structure.

That is:

IDL> a = {i: 0L, j:0L}
IDL> b = {i: 1L, j:1L}
IDL> a = [a, b]
% Conflicting data structures: B,concatenation.
% Execution halted at: $MAIN$

won't work, because

IDL> HELP, a, b, /STRUCT
** Structure <1007dc08>, 2 tags, length=8, refs=1:
I LONG 0
J LONG 0
** Structure <1007da08>, 2 tags, length=8, refs=1:
I LONG 1
J LONG 1

shows that the "names" (in angle brackets) are different.

but

IDL> a = {i: 0L, j:0L}
IDL> b = a
IDL> b.i = 1L
IDL> b.j = 1L
IDL> a = [a, b]
IDL> HELP, a, b, /STRUCT
** Structure <1007d908>, 2 tags, length=8, refs=2:
I LONG 0
J LONG 0
** Structure <1007d908>, 2 tags, length=8, refs=2:
I LONG 1
J LONG 1

does work.

Thanks to David Fanning for this one (and many others).

Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: List yourself in SStreams�
Next Topic: Including files/eps into PS

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

Current Time: Fri Oct 10 06:47:30 PDT 2025

Total time taken to generate the page: 1.60100 seconds