Click or drag to resize

FWriteText Function

Write a string to an open file

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.0
Syntax
 FUNCTION FWriteText(
	 pFile AS USUAL,
	 c AS USUAL,
	 nCount AS USUAL
) AS DWORD

Parameters

pFile
Type: USUAL
The handle of the file. Please see the remark below about the compatibility of X# Runtime file handles and Win32 file handles.
c
Type: USUAL
The string to write.
nCount
Type: USUAL
The number of characters from the string 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 nCount, the operation was successful. If the return value is less than the nCount or 0, this means that the length of the buffer/string is less than number of bytes, or the disk is full, or another error has occurred. FError() can be used to determine the specific error.
Remarks
Tip Tip
The low level File IO functions in the X# runtime are using .Net filestreams in the background.
That means that the file handles returned by FOpen() and FCreate() are not 'normal' file handles, but unique identifiers that are used to find the underlying stream object in a collection of streams in the runtime.
That also means that you can't use file handles for functions such as FRead() and FWrite() that were not created in the X# runtime.
If you want to access the underlying FileStream, then you should call the function FGetStream()
See Also