Dictionary.CompareKeys

From Xojo Documentation

Event


Dictionary.CompareKeys(leftKey As Variant, rightKey As Variant) As Integer

New in 2019r2

Supported for all project types and targets.

Implement this event handler if you would like the Dictionary to support case-sensitive keys.

Parameters

Parameter Description
leftKey The left-hand side of the comparison.
rightKey The right-hand side of the comparison.

Returns

Return a positive integer if lhs is greater than rhs.

Return 0 if lhs is the same as rhs.

Return a negative integer if lhs is less than rhs.

Sample Code

This code does a case-sensitive comparison of the text value of the specified keys:

Var theLeftKey As String = leftKey
Var theRightKey As String = rightKey
Return theLeftKey.Compare(theRightKey, Text.CompareCaseSensitive)