Read a character from a text file.
The operator fread_char reads a character from the current input file. If no character can be read because the end of the file is reached, fread_char returns the character sequence 'eof'. At the end of a line the value 'nl' is returned.
|
FileHandle (input_control) |
file -> integer |
| File handle. | |
|
Char (output_control) |
string -> string |
| Read character or control string ('nl','eof'). | |
repeat > fread_char(FileHandle:Char) (if(Char = 'nl') > fnew_line(FileHandle)) | (if(Char != 'nl') > fwrite_string(FileHandle,Char)) until(Char = 'eof').
If an input file is open the operator fread_char returns 2 (H_MSG_TRUE). Otherwise an exception handling is raised.
fread_char is reentrant and processed without parallelization.
fread_string, read_string, fread_line
open_file, close_file, fread_string, fread_line
Foundation