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

Home » Public Forums » archive » Re: problem with 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: problem with arrays of structures [message #10601 is a reply to message #10599] Wed, 07 January 1998 00:00 Go to previous message
Michael Werger is currently offline  Michael Werger
Messages: 34
Registered: May 1997
Member
Theo Brauers wrote:

> Hi.
>
> I was trying to copy the contents of an array to an
> element of an array of structures:
>
> FUNCTION test2, str
> r = { a: '', b:1.}
> i=n_elements(str)
> r2 = replicate(r, i)
> help, r2, r2.a
> r2.a=str
> r2.b=float(str)
> return, r2
> END
>
> works fine with
> x=test2('100')
> x=test2(['100', '101'])
>
> but fails with
> x=test2(['100'])
>

Replace

r= { a:'',b:1.}

with

r = { a:[''],b:[1.]}

Then you need not to worry about your input (but probably of your output
;-( )
Cheers,

--
Michael Werger ESA ESTEC & Praesepe B.V.
Astrophysics Division mwerger@estec.esa.nl
Postbus 299 http://astro.estec.esa.nl
2200 AG Noordwijk +31 71 565 3783 (Voice)
The Netherlands +31 71 565 4690 (FAX)
[Message index]
 
Read Message
Read Message
Previous Topic: Congressional district boundaries
Next Topic: Re: how to add mark for every points in each plot?

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

Current Time: Thu Mar 26 08:21:41 PDT 2026

Total time taken to generate the page: 1.27993 seconds