Click or drag to resize

MemClear Function

X#
Fill a memory buffer with null characters.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION MemClear(
	ptrDest AS IntPtr,
	dwCount AS DWORD
) AS IntPtr
Request Example View Source

Parameters

ptrDest
Type: IntPtr
A pointer to the memory buffer to fill.
dwCount
Type: DWord
The number of bytes to fill.

Return Value

Type: IntPtr
A pointer to the filled memory buffer.
Remarks
MemClear() sets the first dwCount bytes of the memory buffer pointed to by ptrValue to the ASCII CHR(0) character.
Tip Tip
This function allows the direct manipulation of a memory location and should be used with extreme care.
Examples
This example clears out the contents of an allocated block:
X#
1LOCAL ptrBuff AS PTR
2ptrBuff := MemAlloc(10)
3MemClear(ptrBuff, 10)
See Also