Function to close an open text file
The FCLOSE() function will close an open text file, writing the associated buffers to disk. The <expN> is the file pointer obtained from FCREATE() or FOPEN(). The file pointer must be assigned when the file is first opened using the FOPEN() or FCREATE() functions. If an error occurs during the operation -1 is returned by the FERROR() function.
use accounts 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(m->fp,flist[n],80) next endif fclose(fp) if ferror()=-1 dialog box "The file could not be closed." endif