Read strings from a text file.
The operator ::fread_string reads a string from the current input file. A string begins with the first representable character: letters, numbers, additional characters (except blanks). A string ends when a blank or a line skip is reached. Several successive line skips are ignored. If the end of the file is reached IsEOF return the value 1, otherwise 0.
|
FileHandle (input_control) |
file -> HTuple.long |
| File handle. | |
|
OutString (output_control) |
string -> char * |
| Read character sequence. | |
|
IsEOF (output_control) |
integer -> long * |
| Reached end of file. | |
fwrite_string(FileHandle,"Please enter text and return: ..") ; fread_string(FileHandle,&String,&IsEOF) ; fwrite_string(FileHandle,"here it is again: ") ; fwrite_string(FileHandle,String) ; fnew_line(FileHandle) ;
If a file is open and a suitable string is read ::fread_string returns the value H_MSG_TRUE. Otherwise an exception handling is raised.
::open_file, ::close_file, ::fread_char
Basic operators