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

Home » Public Forums » archive » Reading Values into Individual Array Elements
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: Reading Values into Individual Array Elements [message #5991 is a reply to message #5927] Fri, 15 March 1996 00:00 Go to previous messageGo to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <4i2qfi$3et@news.isc.rit.edu>, Rolando Raqueno <rvrpci@cis.rit.edu> writes:
|>
[...snip...]
|>
|> However, when I try to use a specific element in the array as an
|> argument to the READ statement, IDL no longer prompts me for the
|> value but returns value of the element as shown below.
|>
|> IDL> read,a(3)
|> 4.00000IDL>

Since IDL passes subscripted array elements by value and not by reference,
a(3) is effectively a constant to READ, because READ cannot change
the value of a(3). What you are saying to IDL is therefore basically the
same as:

IDL> read,"TEST"

which is supposed to show the behaviour you described.

|>
|> A workaround would be to use a scalar temporary variable and then
|> assign it to the specific element, but that seemed a bit circuitous
|> and not unlike other languages.
|>

It's a little tedious, but it's the correct solution in this case.

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: .gif files
Next Topic: A simple 'image frames' package

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

Current Time: Fri Oct 10 13:21:46 PDT 2025

Total time taken to generate the page: 1.51831 seconds