Writes characters to a file opened with low-level access
FWRITE( <nHandle>, <cBuffer>, [<nBytes>] ) --> nBytesWritten
<nHandle> DOS file handle number.
<cBuffer> Character expression to be written.
<nBytes> The number of bytes to write.
<nBytesWritten> the number of bytes successfully written.
This function writes the contents of <cBuffer> to the file designated by its file handle <nHandle>. If used, <nBytes> is the number of bytes in <cBuffer> to write.
The returned value is the number of bytes successfully written to the DOS file. If the returned value is 0, an error has occurred (unless this is intended). A successful write occurs when the number returned by FWRITE() is equal to either LEN( <cBuffer>) or <nBytes>.
The value of <cBuffer> is the string or variable to be written to the open DOS file <nHandle>.
The value of <nBytes> is the number of bytes to write out to the file. The disk write begins with the current file position in <nHandle>. If this variable is not used, the entire contents of <cBuffer> is written to the file. To truncate a file, a call of FWRITE( nHandle, “”, 0 ) is needed.
nHandle := FCreate( "x.txt" )
FOR X := 1 TO 10
FWrite( nHandle, Str( x ) )
FClose( nHandle )
Library is rtl
FCLOSE(), FCREATE(), FERROR(), FOPEN(), I2BIN(), L2BIN()