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 #5734 is a reply to message #5725] Fri, 02 February 1996 00:00 Go to previous message
M.W.Gardner is currently offline  M.W.Gardner
Messages: 7
Registered: November 1995
Junior Member
Iarla Kilbane-Dawe <iarla@atm.ch.cam.ac.uk> wrote:

> why does IDL give me an error when I try to do?
>
> a=fltarr(10)
> i = 0
> readf,unit,a(i)
>

Iarla, what error do you get and what exactly are you attempting to do ?

if you haven't defined the unit you get "% READF: Variable is undefined: UNIT"

if unit is defined (eg given a number say 1) and has not been defined in an
open statement you get "% READF: File unit is not open: 1"

If you are trying to read from a file a ten element array then open you file,
read in the data, and close the file like so :

a=fltarr(10)
open,unit,'filename',/get_lun
read,unit,a
close,unit
free_lun,unit

and that should do it. If you don't want to do this then ignore all that and
let me know what you want to do !

Anyway, I hope that helps, if not provide some more info if I have missed the
point.

Matt
--
-----> Matt Gardner EMAIL->m.W.gardner@uea.ac.uk PHONE->+44- 1603-592041
School of Environmental Science,University of East Anglia,Norwich,NR4 7TJ,UK
------------------------------------------------------------ ------------------
opinions are mine - http://www.uea.ac.uk/~e449
[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 11:37:00 PST 2025

Total time taken to generate the page: 2.47660 seconds