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 -> integer |
| File handle. | |
|
OutString (output_control) |
string -> string |
| Read character sequence. | |
|
IsEOF (output_control) |
integer -> integer |
| Reached end of file. | |
fwrite_string(FileHandle,'Please enter text and return: ..') fread_string(FileHandle,String,IsEOF) > fwrite_string(FileHandle,['here it is again: ',String]) fnew_line(FileHandle).
If a file is open and a suitable string is read fread_string returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.
fread_string is reentrant and processed without parallelization.
fread_char, read_string, fread_line
open_file, close_file, fread_char, fread_line
Foundation