Click or drag to resize

MemInt Function

X#
Get a pointer to a matching integer in a memory buffer.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION MemInt(
	ptrBuffer AS IntPtr,
	iValue AS LONG,
	dwCount AS DWORD
) AS IntPtr
Request Example View Source

Parameters

ptrBuffer
Type: IntPtr
A pointer to the memory buffer to examine.
iValue
Type: Long
An integer to match.
dwCount
Type: DWord
The number of integers in ptrBuffer to examine.

Return Value

Type: IntPtr
A pointer to the first occurrence of iValue within the first dwCount integers of ptrBuffer.
If iValue is not matched, MemInt() returns a NULL_PTR.
Remarks
Examples
This example uses MemInt() on a PSZ:
X#
1FUNCTION Start()
2    LOCAL ptrI := "ABCDEFGHIJ" AS PSZ
3    ? MemInt(ptrI, Bin2I("EFGH"), 2)    // A pointer
4    ? MemInt(ptrI, Bin2I("EFGH"), 1)
5// Not found in the first integer of ptrI 0000:0000
See Also