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

Home » Public Forums » archive » 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 #52459 is a reply to message #20472] Thu, 08 February 2007 10:04 Go to previous messageGo to previous message
Mick Brooks is currently offline  Mick Brooks
Messages: 4
Registered: February 2007
Junior Member
On Feb 8, 5:41 pm, "Brian Larsen" <balar...@gmail.com> wrote:

> This is what you did and it is true this is an array with 50 elements
> IDL> HELP, structs.a
> <Expression> INT = Array[50]
>
> but if you look at structs by itself not structs.a, it is the array,
> NOT structs.a
>
> IDL> HELP, structs
> STRUCTS STRUCT = -> <Anonymous> Array[50]
>
> So what is inside the structure?
>
> Here a is inside the struct and it is an int
>
> IDL> HELP, structs, /str
> ** Structure <84bd40c>, 1 tags, length=2, data length=2, refs=1:
> A INT 1

(I think) I'm following you to here...

> Meaning that structs.a[23] doesn't make sense because structs.a is an
> int.

... but this is where you lose me. Doesn't the the first line that you
showed say that structs.a is an array of 50 ints?
Maybe I just can't read the output of HELP properly, but struts.a
certainly sometimes behaves as an array. Try PRINTing it, for
instance.
Or let's compare the output of HELP on a real array of 50 ints:

IDL> HELP, structs.a
<Expression> INT = Array[50]
IDL> HELP, indgen(50)
<Expression> INT = Array[50]

> While structs[23].a does make sense because structs is an array.

Yes, I'm happy with why this is right, but still not clear why
structs.a[23] is wrong.

> This is just one of those lessons that take a while to get a hold of.
>
> Make any sense?

Not really, but thanks for trying.

Cheers,

Mick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: image rotation Fits headers?
Next Topic: .sav format

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

Current Time: Wed Oct 08 17:18:51 PDT 2025

Total time taken to generate the page: 0.00397 seconds