Click here for NewsObjects Overview
InsertExpression Method (Profile Editor Control)
Windows - Visual C++


Description
The InsertExpression method translates the specified RPN expression to InFix notation and replaces the current editing window selection with the resultant expression. Use InsertExpression when inserting a sub-expression into a profile. InsertExpression will not generate global butnots.

Syntax
long result = InsertExpression(LPCTSTR strRPN);

The InsertExpression syntax has these parts:

Part

Description

strRPN

A string containing an RPN search expression.

result

A long integer containing 0, if the operation succeeded, or an error code, otherwise.

Remarks
If the returned error is either DDICTL_E_R_PRFSYNTAXERR, indicating a syntax error, or DDICTL_E_R_INVALCHARINPROF, indicating an invalid character, the SyntaxErrorIndex property will contain the index at which the translation error was detected.

Some RPN profiles like "A B NOT AND" are ambiguous. "A ~ B" and "(A - B)" both convert to that RPN expression. Always use InsertProfileCriteria when loading an entire profile into the editor; otherwise it may generate expressions within expressions causing a syntax error. Always use InsertExpression when inserting a subexpression into a profile; otherwise expression butnots will become global and some stories that should be included in the view will be excluded.

See Also: InsertSource InsertSubject InsertTicker InsertProfileCriteria

Back to: Profile Editor Methods