Function to create an ASCII text file
The FCREATE() function will create a new ASCII text file or truncate an existing file to zero length. The <expC> is the name of the file to be created. When FCREATE() successfully creates a new file it leaves the file open and returns the numeric file pointer. If an error occurs, FCREATE() returns a file pointer with a value of -1. Since the file pointer is required in order to identify an open file to other file functions, always assign the return value to a memory variable. If an error occurs during the operation, -1 is returned by the FERROR() function.
use acc_log scatter to flist m_total=alen(flist) fp=fcreate("new.txt") if ferror()=-1 dialog box "The file could not be created." else for n=1 to m_total fwrite(fp,flist[n],80) next endif fclose(fp) if ferror()=-1 dialog box "The file could not be closed." endif