Click or drag to resize

MemLong Function

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

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

Parameters

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

Return Value

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