Function to return a character string from a text file
The FREADSTR() function returns the next line of a text file, opened by FOPEN(), as a character string. The <expN1> is the file pointer obtained from FOPEN(). The maximum number of bytes to read is specified by the value in <expN2>. The FREADSTR() function sequentially reads each line from the opened text file each time it is used on the file. If an error occurs during the operation, -1 is assigned to the FERROR() function. The file pointer must be assigned when the file is first opened using the FOPEN() function.
use accounts fp=fopen("existing.txt") if ferror()=-1 dialog box "The file could not be opened." else string = freadstr(fp,80) do while not empty(string) ? string string = freadstr(fp,80) enddo endif fclose(fp) if ferror()=-1 dialog box "The file could not be closed." endif