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

Home » Public Forums » archive » Bug in formatted read?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Bug in formatted read? [message #2515] Tue, 02 August 1994 00:33
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
I'm not sure if the following should be called a bug, but it certainly
has caused me a lot of trouble until I realized what was going on.

Normally, during a formatted read one gets an error "End of Input record
encountered" if the input line ends before all the variables have been read
in. But if one includes spaces ('X') in the read format, then IDL
blithely goes along filling the remaining variables with the last character
read. For example,

; IDL Version 3.6 (vms alpha)

a = '23.5'
reads,a,f='(f4.1,1x,f5.1,1x,f5.1)',x,y,z
print,x,y,z
; 23.5000 5.00000 5.00000

In this case, the string to be read contained data only for the first variable
X. So the next two variables were filled with the last character read
'5', and no error message was given. (I use READS here so I don't have
read from a file, but the same thing happens using READF.)

--Wayne Landsman landsman@stars.gsfc.nasa.gov
[Message index]
 
Read Message
Previous Topic: array addressing
Next Topic: Re: array addressing

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

Current Time: Sat Oct 11 07:48:27 PDT 2025

Total time taken to generate the page: 1.03937 seconds