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 #5729 is a reply to message #5725] Fri, 02 February 1996 00:00 Go to previous messageGo to previous message
Ken Knighton is currently offline  Ken Knighton
Messages: 44
Registered: May 1995
Member
> why does IDL give me an error when I try to do?
>
> a=fltarr(10)
> i = 0
> readf,unit,a(i)
>

I'm not sure why IDL gives you an error, but

readf, unit,a(i)

is not going to read anything. a(i) is an expression rather than a
variable. The readf statement requires a named variable in order to
read anything. Try using

a=fltarr(10)
i=0
b=0.0
readf, unit, b
a(i)=b

This is actually mentioned somewhere in the i/o chapter of the user's
manual.

Also, you might want to look at the ASSOC() function and associated i/o.
Because you are reading an array, this might be a better solution.

Ken Knighton knighton@gav.gat.com knighton@cts.com
General Atomics
San Diego, CA
[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 05:52:43 PST 2025

Total time taken to generate the page: 7.52655 seconds