Herror ::fread_string (
    const HTuple &FileHandle,
    char *OutString,
    long *IsEOF
)

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.


Parameters

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.


Example
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) ;

Result

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.


Possible Predecessors

::open_file


Possible Successors

::close_file


Alternatives

::fread_char, ::read_string


See also

::open_file, ::close_file, ::fread_char


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH