Click or drag to resize

Buffer Function

X#
Return an uninitialized string of a specified size.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION Buffer(
	dwSize AS DWORD
) AS STRING
Request Example View Source

Parameters

dwSize
Type: DWord
The number of bytes to return.

Return Value

Type: String
A string of dwSize bytes.
If dwSize is 0, Buffer() returns a NULL_STRING.
Remarks
Buffer() is similar to Space() but with random contents. You should use it, instead of Space(), in cases where an initialization character is not needed.
Examples
This example uses Buffer() to allocate a string then fills it in with the data read from FRead3():
X#
1cBuff := Buffer(8)
2FRead3(ptrHandle, Ptr(_CAST, cBuff), 8)
See Also