FWRITE()
Writes characters to a file.
- Syntax
- FWRITE( <nHandle>, <cBuffer>, [<nBytes>] ) --> nBytesWritten
- Arguments
- <nHandle> DOS file handle number.
- <cBuffer> Character expression to be written.
- <nBytes> The number of bytes to write.
- Returns
- <nBytesWritten> the number of bytes successfully written.
- Description
- This function writes the contents of to the file designated by its file handle . If used, is the number of bytes in 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( ) or .
- The value of is the string or variable to be written to the open DOS file .
- The value of is the number of bytes to write out to the file. The disk write begins with the current file position in . If this variable is not used, the entire contents of is written to the file. To truncate a file. a call of FWRITE( nHandle, "", 0 ) is needed.
- Examples
- nHandle:=FCREATE('x.txt')
- FOR X:=1 to 10
- FWRITE(nHandle,STR(x))
- NEXT
- FCLOSE(nHandle)
- Status
Ready
- Compliance
- This function is not CA-Clipper compatile since it can writes strings greather the 64K
- Files
- Library is Rtl
- See Also