Click or drag to resize

RuntimeState.StringCompare Method (Byte, Byte, Long)

X#
Compare 2 byte arrays respecting the runtime string comparison rules.

Namespace:  XSharp
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 STATIC METHOD StringCompare(
	aLHS AS BYTE[],
	aRHS AS BYTE[],
	nLen AS LONG
) AS LONG
Request Example View Source

Parameters

aLHS
Type: Byte
The first list of bytes.
aRHS
Type: Byte
The second list of bytes.
nLen
Type: Long
The # of bytes to compare.

Return Value

Type: Long
This function returns a numeric value to indicate the order in which the strings should be sorted:
-1LHS precedes RHS in the sort order.
0LHS occurs in the same position as RHS in the sort order.
1LHS follows RHS in the sort order.
Remarks
This method works on BYTE arrays and is used by the RDD system.
This method respects the current setting of SetCollation():
- When the current collationmode is Clipper or Windows then no Ansi - Unicode conversions will be done.The comparisons will be done on the byte arrays.
- When the current collationmode is Unicode or Ordinal then the byte arrays will be converted to Unicode before the comparison is executed.
See Also