Click here for NewsObjects Overview
ConvertCriteria Method (Utility Control)
Windows - Visual C++


Description
The ConvertCriteria method converts search strings from InFix notation to RPN notation and vice versa.

Syntax
long result = ConvertCriteria(strCriteria,bInFixToRpn,bAvoidGlobalButNots);

The ConvertCriteria syntax has these parts:

 Part

Description

StrCriteria

The search string to be converted

BInFixToRpn

A boolean indicating the type of conversion. A TRUE value indicates that the search string is in InFix notation and should be converted to RPN. A FALSE value indicates that the search string is in RPN notation and should be converted to InFix.

bAvoidGlobalButNots

A boolean indicating whether Global "But-Not" statements should be incorporated into the conversion. See the Remarks below.

Result

A long integer indicating the success of the conversion.

Remarks:

If the returned error is DDICTL_E_R_PRFSYNTAXERR, indicating a syntax error, or DDICTL_E_R_INVALCHARINPROF, indicating an invalid character, , or DDICTL_E_R_PROFTOOCOMPLEX for a profile that is too complex, the ConvertCriteriaErrIndex property will contain the index at which the translation error was detected.

If there isn’t an error converting the criteria, the return code will be zero, and the resulting converted string will be accessable via the ConvertCriteria property.

For Infix notation, if the search criteria has an "and" statement, it must be enclosed in parentheses. For example:
"(stock + splits)"

Set the bAvoidGlobalButNots value to TRUE when converting an expression within a profile. Set this value to FALSE when converting an entire profile. In the case where a "but-not" is ambiguous as to whether it refers only to an expression or to the entire profile (as for example A B NOT AND), bAvoidGlobalButNots = TRUE biases to "expression level but-not (A - B)" and bAvoidGlobalButNots = FALSE biases to "global but-not (A ~ B)".

SeeAlso: ConvertCriteriaErrIndex, ConvertString, Profile Editor InFix Notation

Back to: Utility Methods