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.
|
FileHandle (input_control) |
file -> HTuple.long |
| File handle. | |
|
Char (output_control) |
string -> char * |
| Read character or control string ('nl','eof'). | |
do {
fread_char(FileHandle,&Char) ;
if (!strcmp(Char,"nl")) fnew_line(FileHandle) ;
if (!strcmp(Char,"nl")) fwrite_string(FileHandle,Char)) ;
} while(strcmp(Char,"eof")) ;
If an input file is open the operator fread_char returns H_MSG_TRUE. Otherwise an exception handling is raised.
::open_file, ::close_file, ::fread_string
Basic operators