Les Hardy ha scritto:
> Hi Ed,
> I figured it out.
> First of all, depending how the text file was emptied/created, the 
> contents may not be truely empty.
> Gedit for example leaves the 0A (end-of-line) character in the 'empty' 
> file. This is recognised by eof() as a character, so, end-of-file is not 
> found.
> I am not sure if this can be considered a bug in Gambas, but it does 
> mean an eof() is only good for preventing read errors, and is not 
> reliable for testing if a file is empty.
>   
Just breaking in to say that a file with a EOL in it is not an empty 
file - it is a file with an empty line in it...
Given such a file, at first EOF is false; doing a LINE INPUT an empty 
line is read, then EOF turns true. Or, at least, it should go this way.

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to