System.Variants.TCustomVariantType.CompareOp

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function CompareOp(const Left, Right: TVarData;  const Operator: TVarOp): Boolean; virtual;

C++

virtual bool __fastcall CompareOp(const TVarData &Left, const TVarData &Right, const int Operator);

Properties

Type Visibility Source Unit Parent
function public
System.Variants.pas
System.Variants.hpp
System.Variants TCustomVariantType

Description

Implements any comparison operations of which the custom Variant type is capable.

Override CompareOp to implement any comparison operators the custom Variant type supports. Descendants can implement comparison operators by overriding either the Compare or the CompareOp method.

Left is the value that appears to the left of the operator.

Right is the value that appears to the right of the operator.

Operator identifies the operator that appears between Left and Right. It can be any of the following values:

Value Operation

opCmpEQ

equality comparison

opCmpNE

inequality comparison

opCmpLT

less than

opCmpLE

less than or equal

opCmpGT

greater than

opCmpGE

greater than or equal


CompareOp returns True if the comparison is true as specified. It returns False if the specified comparison does not hold true.

As implemented in TCustomVariantType, CompareOp raises a system error indicating an invalid operation.

See Also