f_eof

Top 

The function delivers a return value on the contents to be selected of a file covers. The suitable file becomes to the function about this "acts" informed (see f_open). The function is suited to finish itself, for example, as a condition around a "loop" line-by-line a text file selects (see example).

Parametre

f_eof <acts>

The information of a file - handel is necessary.

Return value

Proves 0 if still data (lines) are given in the file,

Proves 1 whom no more data are given or the file end is reached.

Tip: The file end is not recognised yet if the last line is read, but only with the following line.

Example

With the following procedure FGETS a text file (Moskitos.txt) is selected line-by-line. In line 6 it is checked with the function f_eof the variable "condition". In every flow of the „c_while loop“ the condition with the function m_gt (really greater) is checked. If the result of the loop condition instead of 1 is 0 the loop is finished.

 

DefineProcedure FGETS

Declare DateiHandle line Bediengung

Value DateiHandle f_open (C:\Temp\Moskitos.txt r)

Value Bediengung 0

c_while "m_gt (1 Value (Bediengung))"

Value Bediengung f_eof (Value (DateiHandle))

Value line f_gets (Value (DateiHandle))

Echo line Value (line)

c_endWhile

f_close Value (DateiHandle)

EndProcedure

 

Tip: To achieve a visible line issue the Moskito's expenses on dialogue issue had to go (see Echo ) stand.

 

See also

f_get

c_while

f_close

m_gt

f_open