RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.CompareOp Method

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

Pascal
function CompareOp(const Left: TVarData; const Right: TVarData; const Operator: TVarOp): Boolean; virtual;
C++
virtual __fastcall Boolean CompareOp(const TVarData Left, const TVarData Right, const TVarOp Operator);

Override CompareOp to implement any comparison operators the custom System::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 
equality comparison  
inequality comparison  
less than  
less than or equal  
greater than  
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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!