company logo

PropertyHandle :: CompareKey - Compare two identifying key values

The function compares two identifying key values. The keys are compared according to the data types of its components.

The function returns -1 when the the value for the first key (ident_key1) is lower than the value for the second key (ident_key2). 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 returns ERIC (-99) if the values are not comparable, i.e. when no identifying key has been defined or when the property handle is invalid.

Return value:  Compare result (   )

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 overview

Implementation details

  1. - internal feature (not documented)
    int8 PropertyHandle  :: CompareKey ( ::Key ident_key1, ::Key ident_key2 )
    • ident_key1 - First key value

      The key is provided in the internal key format. When necessary the key value can be converted from a string into the internal format using the StringToKey() function. Regardless on the type key values are passed as Key handle or (char *) areas.

    • ident_key2 - Second key value

      The key is provided in the internal key format. When necessary the key value can be converted from a string into the internal format using the StringToKey() function. Regardless on the type key values are passed as Key handle or (char *) areas.

  2. to list
  3. - internal feature (not documented)
    int8 PropertyHandle  :: CompareKey ( ::Key ident_key1, ::Key ident_key2, NString &keyname )
    • ident_key1 - First key value

      The key is provided in the internal key format. When necessary the key value can be converted from a string into the internal format using the StringToKey() function. Regardless on the type key values are passed as Key handle or (char *) areas.

    • ident_key2 - Second key value

      The key is provided in the internal key format. When necessary the key value can be converted from a string into the internal format using the StringToKey() function. Regardless on the type key values are passed as Key handle or (char *) areas.

    • keyname - Name of sort key

      The order key name must be a key name defined for the given structure. The sort key is passed as 0-terminated string with maximum 40 characters.

  4. to list