value_compare


Description:


public int value_compare (Value value1, Value value2)

Compares two values of the same type, with the exception that a value of any type can be compared to a GDA_TYPE_NULL value, specifically:

  • if value1 and value2 are both GDA_TYPE_NULL values then the returned value is 0
  • if value1 is a GDA_TYPE_NULL value and value2 is of another type then the returned value is -1
  • if value1 is of another type and value2 is a GDA_TYPE_NULL value then the returned value is 1
  • in all other cases, value1 and value2 must be of the same type and their values are compared

Parameters:

value1

a Value to compare (not null)

value2

the other Value to be compared to value1 (not null)

Returns:

if both values have the same type, returns 0 if both contain the same value, an integer less than 0 if value1 is less than value2 or an integer greater than 0 if value1 is greater than value2.


Namespace: Gda
Package: libgda-5.0



2022 vala-language.org