company logo

PropertyHandle :: Compare - Compare the values for two property handles

The function compares the values of the two property handles. The function cannot compare collections.

The function returns -1 when the the value for the property handle is lower than the value for the passed property handle. The function returns 1 when the the value for the property handle is higher than the value for the passed property handle. The function returns 0 if the values are equal.

The function returns ERIC (-99) if the values are not comparable, i.e. no instance selected for the property or invalid property handle.

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 details

  1. Compare with date value
    int16 PropertyHandle  :: Compare ( dbdt date_val )

    This implementation compares the value in the property handle with the passed date value. Data conversion is performed for the passed value when required. Converting date values to string values may result in different string values for the same date value depending on the national setting. Hence, string values should not be compared with date values. In this case it is more appropriate to compare the date values directly ( ph.GetDate() == date_val).

    • date_val - Date value

      The data value is passed in the internal data format.

  2. to list
  3. Compare with double value
    int16 PropertyHandle  :: Compare ( double double_val )

    This implementation compares the value in the property handle with the passed double float value. Data conversion is performed for the passed value when required.

    • double_val - Double value

      A double value is a 64 bit floating number.

  4. to list
  5. Compare with 32-bit integer value
    int16 PropertyHandle  :: Compare ( int32 long_val )

    This implementation compares the value in the property handle with the passed integer value. Data conversion is performed for the passed value when required.

    • long_val - Integer value

      The value is passed as platform independent 32-bit integer value.

  6. to list
  7. Compare with other property handle
    int16 PropertyHandle  :: Compare ( PropertyHandle &cprop_hdl, logical case_opt_w=NO )

    This implementation compares the value in the property handle with the value in the passed property handle. Data conversion  is performed when required.

    • cprop_hdl - Property Handle
    • case_opt_w - - internal feature (not documented) Default: NO
  8. to list
  9. Compare with string value
    int16 PropertyHandle  :: Compare ( NString &cnstring, logical case_opt_w=NO )

    This implementation compares the value in the property handle with the value in the passed string. Data conversion is performed for the string when required.

    • cnstring - String containing the text
    • case_opt_w - - internal feature (not documented) Default: NO
  10. to list
  11. Compare with time value
    int16 PropertyHandle  :: Compare ( dbtm time_val )

    This implementation compares the value in the property handle with the passed time value. Data conversion is performed for the passed value when required. Converting time values to string values may result in different string values for the same time value depending on the national setting. Hence, string values should not be compared with time values. In this case it is more appropriate to compare the time values directly ( ph.GetTime() == time_val).

    • time_val - Time value

      The time value is passed in the internal data format.

  12. to list
  13. - internal feature (not documented)
    int16 PropertyHandle  :: Compare ( fld *fldptr, logical case_opt_w=NO )
    • fldptr - - internal feature (not documented)
    • case_opt_w - - internal feature (not documented) Default: NO
  14. to list
  15. - internal feature (not documented)
    int16 PropertyHandle  :: Compare ( char *cstring, logical case_opt_w=NO )
    • cstring - C string

      Usually, the string has to be 0-terminated, but there might be exceptions.

    • case_opt_w - - internal feature (not documented) Default: NO
  16. to list