CompareBytes

int CompareBytes (char *buffer#1, int buffer#1Index, char *buffer#2, int buffer#2Index, int numberOfBytes, int caseSensitive);

Purpose

Compares the numberOfBytes bytes that start at position buffer#1Index of buffer#1 to the numberOfBytes bytes that start at position buffer#2Index of buffer#2. CompareBytes returns an integer value that indicates the lexicographic relationship between the two sets of bytes.

Parameters

Input
Name Type Description
buffer#1 string One of the two variables whose contents are to be compared.
buffer#1Index integer Zero–based index specifying the location within buffer#1 at which to begin comparing bytes.
buffer#2 string One of the two variables whose contents are to be compared.
buffer#2Index integer Zero–based index specifying the location within buffer#2 at which to begin comparing bytes.
numberOfBytes integer Number of bytes to compare.
caseSensitive integer Specifies whether alphabetic characters must have the same case to be considered equal.

If caseSensitive is zero, CompareBytes compares alphabetic characters without regard to case. If caseSensitive is a nonzero value, CompareBytes considers alphabetic characters equal only if they have the same case.

Return Value

Name Type Description
result integer Indicates the lexicographic relationship between the selected sets of bytes from buffer#1 and buffer#2.

Code Description
–1 Bytes from buffer#1 are less than bytes from buffer#2.
0 Bytes from buffer#1 are identical to bytes from buffer#2.
1 Bytes from buffer#1 are greater than bytes from buffer#2.