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

Home » Public Forums » archive » Re: Arrays of Structures
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: Arrays of Structures [message #20450] Thu, 22 June 2000 00:00 Go to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
Sorry if I repeat some of the things said above. The following should
work, because, just like Ben said, despite S1 and S2 are both anonimous
for the user, they are internally different for IDL. Make S2 the same as S1:

IDL> S1 = {a:0, b:.1, c:''}
IDL> S2 = S1
S2.a = 3 & S2.b = 7 & S2.c = 'x'
IDL> A = Replicate(S1,3)
IDL> A[1] = S2 ; can replace a structure.

Cheers,
Pavel

> Ah, that was easy!
>
> Now here's 'How come #2'
> I know that I can replace a given field in one of the structures.
> How come I can't replace Array element X with an identical structure (as
> I would with a named structure?)
>
> IDL> S1 = {a:0, b:.1, c:''}
> IDL> S2 = {a:3, b:7., c:'x'}
> IDL> A = Replicate(S1,3)
> IDL> A(1).c = 'q' ;replace a field value without a
> problem
> IDL> A[1] = S2 ; can't replace a structure.
> % Conflicting data structures: S2,A.
> % Execution halted at: $MAIN$
>
> Thanks,
> Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Questions on External Development examples
Next Topic: A (too?) simple question about importing data

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

Current Time: Wed Oct 08 15:33:26 PDT 2025

Total time taken to generate the page: 0.00497 seconds