HALCON Reference Manual 10.0.2
Table of Contents / File / Text ClassesClassesClasses | | | Operators

fread_linefread_linefread_lineFreadLineFreadLine (Operator)

Name

fread_linefread_linefread_lineFreadLineFreadLine — Read a line from a text 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)

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

HTuple HFile::FreadLine(HTuple* IsEOF) const

void HOperatorSetX.FreadLine(
[in] VARIANT FileHandle, [out] VARIANT* OutLine, [out] VARIANT* IsEOF)

BSTR HFileX.FreadLine([out] Hlong* IsEOF)

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

string HFile.FreadLine(out int isEOF)

Description

The operator fread_linefread_linefread_lineFreadLineFreadLine reads a line from the current input file (including the line skip). If the end of the file is reached IsEOFIsEOFIsEOFIsEOFisEOF returns the value 1, otherwise 0.

Attention

The maximum string length is 1024 character (including the end of string character).

Parallelization

Parameters

FileHandleFileHandleFileHandleFileHandlefileHandle (input_control)  file HFile, HTupleHFile, HTupleHFileX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

File handle.

OutLineOutLineOutLineOutLineoutLine (output_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Read line.

IsEOFIsEOFIsEOFIsEOFisEOF (output_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (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_linefread_lineFreadLineFreadLine returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

open_fileopen_fileopen_fileOpenFileOpenFile

Possible Successors

close_fileclose_fileclose_fileCloseFileCloseFile

Alternatives

fread_charfread_charfread_charFreadCharFreadChar, fread_stringfread_stringfread_stringFreadStringFreadString

See also

open_fileopen_fileopen_fileOpenFileOpenFile, close_fileclose_fileclose_fileCloseFileCloseFile, fread_charfread_charfread_charFreadCharFreadChar, fread_stringfread_stringfread_stringFreadStringFreadString

Module

Foundation


Table of Contents / File / Text ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH