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

Home » Public Forums » archive » Expression question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Expression question [message #54266] Wed, 30 May 2007 14:05
shd is currently offline  shd
Messages: 4
Registered: June 2006
Junior Member
Code:
=========================
pro shd_test

st = {a:0, b:0}

arr = [st, st, st, st, st]

help, st
help, arr[0]
help, (arr[0]).a
help, arr.a
help, (arr.a)[0]

st.a = 1
arr[0] = {a:1, b:0}
(arr[0]).a = 1
;(arr.a)[0] = 1
end
===========================

Output:
===========================
IDL> shd_test
ST STRUCT = -> <Anonymous> Array[1]
<Expression> STRUCT = -> <Anonymous> Array[1]
<Expression> INT = 0
<Expression> INT = Array[5]
<Expression> INT = 0
Attempt to store into an expression: Structure reference.
Execution halted at: TEST_ODDITY 15 C:\Dev\IDL\projects\test
\test_oddity.pro
$MAIN$

===========================

I can assign a value to "arr[0]" and not "(arr[0]).a". I also tried
"(arr.a)[0]" and got a similar error. What am I missing here?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: iTools for Intel Mac - displays plot then freezes
Next Topic: Re: Expression question

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

Current Time: Wed Oct 08 13:53:21 PDT 2025

Total time taken to generate the page: 0.00593 seconds