MemComp Function |
Namespace: XSharp.RT
FUNCTION MemComp( ptrFirst AS IntPtr, ptrSecond AS IntPtr, dwCount AS DWORD ) AS LONG
public static int MemComp( IntPtr ptrFirst, IntPtr ptrSecond, uint dwCount )
1MemComp() compares the ANSI values of the first <paramref name="dwCount" /> bytes in each memory buffer. Note that some characters (such as ä can have a greater ANSI value but a lower OEM value than other characters (such as ).<br /> 2The system only uses the ANSI set.
1FUNCTION Compare() 2 LOCAL pszC1 := "abc" AS PSZ 3 LOCAL pszC2 := "abcd" AS PSZ 4 LOCAL pszChar1 := "ä" AS PSZ 5 LOCAL pszChar2 := "ß" AS PSZ 6 ? MemComp(pszC1, pszC2, 4) // -1 7 ? MemComp(pszC2, pszC1, 4) // 1 8 // The ANSI value of "ä" is greater than "ß" 9 // although its OEM value is less. 10 ? MemComp(pszChar1, pszChar2) // 1