file_str_read (var handle,STRING* string)

Reads text from the file with the given handle into the given string, until a delimiter is reached. The delimiter is either a '0' byte in the file, or a line feed, or a comma (','). This way, comma separated strings from a database file can be read. The file must be open for reading. The original length of the string won't be overwritten.


handle - File handle.
string - string to receive the file content.


0..4000 - number of characters read (4000 max)
-1 - end of file reached



string test_str[8];
fhandle = file_open_read("test.txt"); // test.txt contains "this,is,a,test"
file_str_read(fhandle,test_str); // test_str now contains "this"

See also:

file_open_read, file_close, file_var_read, file_str_write, file_chr_read, file_asc_write, file_asc_read, txt_load, delimit_str ► latest version online