Click or drag to resize

FWriteText3 Function

Write the contents of a buffer to an open file, with SetAnsi() dependency.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION FWriteText3(
	ptrHandle AS IntPtr,
	ptrBuffer AS BYTE[],
	dwBytes AS DWORD
) AS DWORD
View Source

Parameters

ptrHandle
Type: IntPtr
The handle of the file to write to.
ptrBuffer
Type: Byte
A pointer to the buffer to write.
dwBytes
Type: UInt32
The number of bytes in <ptrBuffer> to write, beginning at the current file pointer position.

Return Value

Type: UInt32
The number of bytes written.  If the value returned is equal to <dwBytes>, the operation was successful.  If the return value is less than <dwBytes> or 0, this means that the length of <ptrBuffer> is less than <dwBytes>, or the disk is full, or another error has occurred.  FError() can be used to determine the specific error.
Remarks
FWriteText3() is the same as FWrite3() except that an ANSI to OEM conversion is made if SetAnsi() is FALSE.
Examples
This example writes the contents of a PSZ to a file.
X#
LOCAL pszBuff AS PSZ
LOCAL ptrHandle AS PTR
pszBuff := "hello" // psz converted data
ptrHandle := FOpen2("temp.bin", FO_READWRITE)
IF ptrHandle != F_ERROR
        FWriteText3(ptrHandle, pszBuff, PszLen(pszBuff))
ENDIF
See Also