EOF() depending loops

Everything else that doesn't fall into one of the other PB categories.
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

EOF() depending loops

Post by Dreglor »

eof() doesn't seam to work in empty file in the result is that loops reading the file depending of eof don't end
~Dreglor
plouf
Enthusiast
Enthusiast
Posts: 282
Joined: Fri Apr 25, 2003 6:35 pm
Location: Athens,Greece

Post by plouf »

OpenFile(0,"c:\1.txt")
Debug "Start"
While Eof(0)=0
Debug "i am looping"
Wend
Debug "End"

this one ends immidiatly
or you dont mean this ?
Christos
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

sry but i just figured out for some reason on my computer it returns -1 at when it's at the end
the tool bar help says it would be 1 if it hit the end not -1
~Dreglor
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Dreglor wrote:sry but i just figured out for some reason on my computer it returns -1 at when it's at the end
the tool bar help says it would be 1 if it hit the end not -1
Little Tip: True means <>#False. Don't check a=#true, check a<>#false
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

It would be really nice if #FALSE and #TRUE (and logical returns of same) were fixed values, 0 and 1.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Dare2 wrote:It would be really nice if #FALSE and #TRUE (and logical returns of same) were fixed values, 0 and 1.
Not many computer languages that work that way... 0 or NULL are always FALSE, but TRUE anything except FALSE...
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

27 (TRUE)

But it would still be nice ... :)
Post Reply