Roger Blanchard
413 posts
Registered:
29 Jun 2018
10 Jul 2018
Link to this post
Is there a reason why CONTAINS is NOT supported as a valid Operator?
/*------------------------------------------------------------------------------
Purpose: Returns the OperatorEnum matching the UltraGridFilterCell FilterOperator
Notes: Supported UltraGrid FilterOperators per data type (plUseOperators = TRUE):
LOGICAL: Equals, NotEquals
DATE, DATETIME, DATETIME-TZ, Equals, NotEquals, GreaterThan, GreaterThanOrEqualTo,
DECIMAL, INTEGER, INT64: LessThan, LessThanOrEqualTo
CHARACTER, LONGCHAR: Equals, NotEquals, StartsWith, Like, EndsWith,
GreaterThan, GreaterThanOrEqualTo, LessThan, LessThanOrEqualTo
This method returns MATCHES for EndsWith. The BuildQueryExpression method
is required to convert the filter pattern from "abc" to "*abc"
@param poFilter The FilterOperator of the UltraGridFilterCell
@return The resulting OperatorEnum value
------------------------------------------------------------------------------*/
METHOD PUBLIC STATIC OperatorEnum OperatorFromUltraGrid (poFilter AS FilterComparisionOperator):
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:Equals) THEN
RETURN OperatorEnum:EQ .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:NotEquals) THEN
RETURN OperatorEnum:NE .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:GreaterThan) THEN
RETURN OperatorEnum:GT .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:GreaterThanOrEqualTo) THEN
RETURN OperatorEnum:GE .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:LessThan) THEN
RETURN OperatorEnum:LT .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:LessThanOrEqualTo) THEN
RETURN OperatorEnum:LE .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:StartsWith) THEN
RETURN OperatorEnum:Begins .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:Like) THEN
RETURN OperatorEnum:Matches .
IF EnumHelper:AreEqual(poFilter, FilterComparisionOperator:EndsWith) THEN
RETURN OperatorEnum:Matches .
END METHOD .