Click or drag to resize

MemLong Function

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

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

Parameters

ptrBuffer
Type: IntPtr
A pointer to the memory buffer to examine.
liValue
Type: Int32
The long integer value to match.
dwCount
Type: UInt32
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#
FUNCTION Start()
        LOCAL ptrLI := "ABCDEFGHIJ" AS PSZ
        ? MemLong(ptrLI, Bin2L("EFGH", 2))                // A pointer
        ? MemLong(ptrLI, Bin2L("EFGH", 1))
        // Not found in the first long integer of ptrLI
        // 0000:0000
See Also