fread_char ( : : : Char )

Read a character from a text file.

The operator fread_char reads a character from the current input file. Before opening the first file the standard input ('standard_input) is used for reading. It can be reactivated at any time via the operator set_file('standard_input'). If the operator reads beyond the end of the file the operator fread_char returns the character sequence 'eof'. At the end of a line the value 'nl' is returned.


Parameters

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


Example
repeat >
fread_char(:::Char) >
(if(::Char = 'nl':) > fnew_line(:::) |  
if(::Char != 'nl':) > fwrite_string(::Char:)) > 
until(::Char = 'eof':).

Result

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


Possible Predecessors

open_file, set_file


Possible Successors

close_file


Alternatives

fread_string, read_string


See also

open_file, close_file, get_file, set_file, fread_string



Copyright © 1996-1997 MVTec Software GmbH