Page 1 of 1 1
Topic Options
#61978 - 2002-01-10 03:24 PM EOF sign
Anonymous
Unregistered


Dear Friends

I want to read a text file line by line until the end of it with "READLINE" command.
How do I know when I get the EOF (End of file) ? EOL (end of line)?

Thanks

Mike

Top
#61979 - 2002-01-10 03:38 PM Re: EOF sign
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Mike,

if it isn't a 0k file, @error should be set by readline() if it reachs eof

J.

_________________________



Top
#61980 - 2002-01-10 03:46 PM Re: EOF sign
Anonymous
Unregistered


$value = Readline(filenumber)
reads a line of ascii data up to a carriage return character.
If you are at end of file then Readline returns -1.
(other errors are possible. eg file is open for output only)
Usually the following is all that is required
$value = ReadLine(1)
WHILE @Error = 0
; process line contents
$value = ReadLine(1)
LOOP
; file has been processed

Top
#61981 - 2002-01-10 05:43 PM Re: EOF sign
Anonymous
Unregistered


THANKS FOR ALL ITS WORK !!!!

MIKE

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.079 seconds in which 0.049 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org