Herror ::fread_char (
    const HTuple &FileHandle,
    char *Char
)

Read a character from a text file.

The operator ::fread_char reads a character from the current input file. ::fread_char returns the character sequence 'eof'. At the end of a line the value 'nl' is returned.


Parameters

FileHandle (input_control)
file -> HTuple.long
File handle.

Char (output_control)
string -> char *
Read character or control string ('nl','eof').


Example
do {
  fread_char(FileHandle,&Char) ;
  if (!strcmp(Char,"nl")) fnew_line(FileHandle) ;  
  if (!strcmp(Char,"nl")) fwrite_string(FileHandle,Char)) ; 
} while(strcmp(Char,"eof")) ;

Result

If an input file is open the operator fread_char returns H_MSG_TRUE. Otherwise an exception handling is raised.


Possible Predecessors

::open_file


Possible Successors

::close_file


Alternatives

::fread_string, ::read_string


See also

::open_file, ::close_file, ::fread_string


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH