Write a string, a carriage-return character, and a linefeed character to an open file, specifying three strongly-typed arguments.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.7
Syntax FUNCTION FPutS3(
ptrHandle AS IntPtr,
cBuffer AS STRING,
dwBytes AS DWORD
) AS DWORD
public static uint FPutS3(
IntPtr ptrHandle,
string cBuffer,
uint dwBytes
)
Request Example
View SourceParameters
- ptrHandle
- Type: IntPtr
The handle of the file to write to. - cBuffer
- Type: String
The string to write. - dwBytes
- Type: UInt32
The number of bytes in <cBuffer> 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> + 2, the operation was successful.
If the return value is less than <dwBytes> + 2 or 0, this means that the length of <cBuffer> was less than <dwBytes>, or the disk is full, or another error has occurred.
Remarks
This function is assumed to handle raw binary data and is not dependent upon the status of SetAnsi(). FWriteText() and FWrite4(), on the other hand, are dependent upon SetAnsi().
Examples
This example uses FPuts3() to write 5 bytes. The carriage-return/linefeed pair increase the return value by 2:
1ptrHandle := FOpen2("c:\data\sales", FO_READWRITE)
2? FPuts3(ptrHandle, "Line1", 5)
See Also