Eof() In Word documents

Windows specific forum
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Eof() In Word documents

Post by Killswitch »

Does Eof() work properly with word documents? I was playig about with the commands a few minutes ago, and my code works perfectly with a .txt document but with a word document it just keeps on going!

i.e: It had one line in it 'jimmy' and was printing thousands of blank lines to the console, so much so that it crashed the program.

I haven't posted the code as I don't think its relevent.
~I see one problem with your reasoning: the fact is thats not a chicken~
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

The function works properly with all types of files.

A word document does contain lots of binary data. It is no plain text format.
(for example, save an empty word page to disk, you get a 19kb file. There is
obviously no text in it, but lots of other data.)

Of course, if you just try to read that as text and print it to the console,
you get lots of empty lines.

Timo
quidquid Latine dictum sit altum videtur
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

I've heard the format also stores info about the origin of the file...(to track down baddies and such)... Apparently they've caught many a hacker this way :twisted:
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Thank you for that extremly relevent comment, :?: :?: 8O
I suppose I could just rename the word document to a .txt document, then I could work it out that way.
~I see one problem with your reasoning: the fact is thats not a chicken~
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Killswitch wrote:Thank you for that extremly relevent comment, :?: :?: 8O
I suppose I could just rename the word document to a .txt document, then I could work it out that way.
Not sure that would work (if you were being serious - and if you are using readstring) because, as Freak pointed out, a word document does not only contain text.

Also, maybe relax a little. :P
@}--`--,-- A rose by any other name ..
Post Reply