Property :: compareKey - Compare key values for passed key
The function compares two key values according to the key definition passed as sKeyName to the function ( key property). Keys are compared according to the data types of its components.
The function returns -1 when the the value for the first key ( vKey1 ) is lower than the value for the second key ( vKey2 ). The function returns 1 when the the first value is higher than the second one. The function returns 0 when the keys are are equal.
The function throws an exception when values are not comparable, i.e. when no valid key has been passed or when one the property handle is not valid. The functions ignores key definitions, set for the parameters vKey1 and vKey2 .
The result of a comparison is an integer value with the following meaning:
- 0: both operands have the same value
- 1: the calling operand is greater than the passed operand
- -1: the calling operand is smaller than the passed operand
Implementation details
- vKey1
- Key value
The key value is provided as typed string in ESDF or CSV format. Key components might be separated by '|' or ';'.
In order to pass no key value, an empty string ( String() ) can be passed.
// key: name;first_name
Miller;Paul // simple positioned OIF key
"Miller";"Paul Mary" // special characters must be quoted
- vKey2
- Key value
The key value is provided as typed string in ESDF or CSV format. Key components might be separated by '|' or ';'.
In order to pass no key value, an empty string ( String() ) can be passed.
// key: name;first_name
Miller;Paul // simple positioned OIF key
"Miller";"Paul Mary" // special characters must be quoted
- sKeyName
- Key name
The key name must be the name of a key defined for the given structure. The key name is passed as string with maximum 40 characters.
In order to pass no key name, an empty string ( String() ) has to be passed.