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

Home » Public Forums » archive » [Q] readf into an array error
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: [Q] readf into an array error [message #5732 is a reply to message #5725] Fri, 02 February 1996 00:00 Go to previous messageGo to previous message
peter is currently offline  peter
Messages: 80
Registered: February 1994
Member
Iarla Kilbane-Dawe (iarla@atm.ch.cam.ac.uk) wrote:

: Hello,

: why does IDL give me an error when I try to do?

: a=fltarr(10)
: i = 0
: readf,unit,a(i)

This is due to the argument passing mechanism used in IDL. If an array
is passed to a function, it is passed by reference. If a subarray is
passed, it is passed by value, and thus cannot be overwritten.

To accomplish what you want, you need to do

temp = a(i)
readf,unit,temp
a(i) = temp

It is ugly! The syntax gives no clue what is happening, and the
manual is exceptionally obscure.

Peter

--------------------------------
Peter Webb, HP Labs Medical Dept
E-Mail: peter_webb@hpl.hp.com
Phone: (415) 813-3756
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: call_external with common blocks?
Next Topic: Q:Unable to allocate memory?

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

Current Time: Sun Nov 30 01:50:05 PST 2025

Total time taken to generate the page: 0.24379 seconds