Re: READF: Input conversion error. [message #91379 is a reply to message #91375] |
Tue, 07 July 2015 09:43   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
On 07/07/15 11:53, Priyadarsini Sivaraj wrote:
> On Tuesday, 7 July 2015 11:39:52 UTC-4, David Fanning wrote:
>> Priyadarsini Sivaraj writes:
>>
>>> I have a problem again with the code above..All of a sudden, I keep getting this error,
>>> 'READF: End of file encountered.'
>>>
>>> At the line,
>>>
>>> 'READF, lun1, id, x, y, lat, lon'
>>>
>>> in the loop,
>>>
>>> WHILE ~EOF(lun1) DO BEGIN
>>> READF, lun1, id, x, y, lat, lon
>>> pt = [id,x,y,lat,lon]
>>> points = [points , pt]
>>> ENDWHILE
>>>
>>> What can be done to overcome this error?Please do help me.
>>
>> I would say make sure the file contains what you *think* it contains.
>> You are probably mistaken. :-)
>>
>> Cheers,
>>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
>
> Yes.My file does contain all the necessary information. The exact
> codesnippet has worked earlier.Now, I am not able to deduce what could be
> the fault. :-(
If the code worked before then the only other thing that has changed is
the file itself, no?
The error message you are getting is quite clear - you're trying to read
past the end of the file.
You could try looking at using the ON_ERROR (or setting up an exception
handler with CATCH) command to print out the values of id, x, y, lat,
and lon *after* the error has occurred to see if they are what they
should be.
Also, you could print out the values after they are read successfully,
too. It might be a lot of output to screen, but it can't hurt while
you're debugging.
cheers,
paulv
|
|
|