ClassesClasses | | Operators

fread_linefread_lineFreadLineFreadLine (Operator)

Name

fread_linefread_lineFreadLineFreadLine — Read a line from a file.

Signature

fread_line( : : FileHandle : OutLine, IsEOF)

Herror fread_line(const Hlong FileHandle, char* OutLine, Hlong* IsEOF)

Herror T_fread_line(const Htuple FileHandle, Htuple* OutLine, Htuple* IsEOF)

void FreadLine(const HTuple& FileHandle, HTuple* OutLine, HTuple* IsEOF)

HString HFile::FreadLine(Hlong* IsEOF) const

static void HOperatorSet.FreadLine(HTuple fileHandle, out HTuple outLine, out HTuple isEOF)

string HFile.FreadLine(out int isEOF)

Description

The operator fread_linefread_lineFreadLineFreadLineFreadLine reads a line from the current input file (including the line skip) defined by the handle FileHandleFileHandleFileHandleFileHandlefileHandle. The input file must be opened in ASCII format. The read line is returned in parameter OutLineOutLineOutLineOutLineoutLine. If the end of the file is reached, IsEOFIsEOFIsEOFIsEOFisEOF returns the value 1, otherwise 0.

Execution Information

Parameters

FileHandleFileHandleFileHandleFileHandlefileHandle (input_control)  file HFile, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

File handle.

OutLineOutLineOutLineOutLineoutLine (output_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Read line.

IsEOFIsEOFIsEOFIsEOFisEOF (output_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Reached end of file.

Example (C)

do {
  fread_line(FileHandle,&Line,&IsEOF) ;
} while(IsEOF==0) ;

Result

If the file is open and a suitable line is read, fread_linefread_lineFreadLineFreadLineFreadLine returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Possible Predecessors

open_fileopen_fileOpenFileOpenFileOpenFile

Possible Successors

close_fileclose_fileCloseFileCloseFileCloseFile

Alternatives

fread_charfread_charFreadCharFreadCharFreadChar, fread_stringfread_stringFreadStringFreadStringFreadString

See also

open_fileopen_fileOpenFileOpenFileOpenFile, close_fileclose_fileCloseFileCloseFileCloseFile, fread_charfread_charFreadCharFreadCharFreadChar, fread_stringfread_stringFreadStringFreadStringFreadString

Module

Foundation


ClassesClasses | | Operators