Difference between revisions of "FCREATE()"
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Function to create an ASCII text file | Function to create an ASCII text file | ||
Line 12: | Line 8: | ||
==See Also== | ==See Also== | ||
− | [[FCLOSE()]], [[FERROR()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREADSTR()]], [[FWRITE()]], [[MEMOREAD()]], [[MEMOWRITE()]], [[TEXTEDIT()]] | + | [[FCLOSE()]], [[FEOF()]], [[FERROR()]], [[FFLUSH()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREAD()]], [[FREADSTR()]], [[FSEEK()]], [[FWRITE()]], [[MEMOREAD()]], [[MEMOWRITE()]], [[TEXTEDIT()]] |
Line 40: | Line 36: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:ASCII File Access]] | [[Category:ASCII File Access]] | ||
[[Category:ASCII File Access Functions]] | [[Category:ASCII File Access Functions]] |
Latest revision as of 17:20, 27 November 2009
Purpose
Function to create an ASCII text file
Syntax
FCREATE(<expC>)
See Also
FCLOSE(), FEOF(), FERROR(), FFLUSH(), FGETS(), FOPEN(), FPUTS(), FREAD(), FREADSTR(), FSEEK(), FWRITE(), MEMOREAD(), MEMOWRITE(), TEXTEDIT()
Description
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.
Example
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
Products
Recital Server, Recital