Salesforce

Expression Editor (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Expression Editor (Magic xpa 2.x)

You can access the Expression Editor by selecting Expression Rules from the Task menu, pressing Ctrl+E, or by zooming from any expression field.

The Expression Editor is a modal window that lets you enter and display expressions in a table format. When you right-click, an extensive context menu will appear, where you can access the various Selection lists. You can also access various Selection lists by clicking on the icons at the top of the window or by using the shortcuts. The Variable pane is available on the right-hand side of the window. You can press F5 from the Expression Editor to reach the Variable list.

An expression is a constant or a formula for computing a value, consisting of a sequence of operators indicating the action to be performed and operands on which the operation is performed. Operands may contain variables, functions, literals, or other sub-expressions.

The order of the expressions in the expression list is not important.

Each entry in the Expression Editor evaluates to a Numeric value, an Alpha string, BLOB, or a Logical value (TRUE or FALSE), depending on the type of variable and functions used.

If an invalid combination of types is used, Magic xpa displays an error message.

When working in a Rich Client program, characters will appear to the left of the expression in the Expression Editor indicating whether the expression is client-side, server-side, mixed, and so on. For additional information, see Rich Client Server/Client Handling.

Strings

A string value in an expression must be surrounded by a single quotation mark (for example: 'abc').

To get the value of a single quotation mark character, you should use a sequence of two single quotation marks inside another pair of single quotation marks. For example, the value of 'it''s' will be treated as it's.

A double quotation mark (") is considered a regular character.

Functions

Functions can be nested to any level using parentheses. For example, Len(LTrim(RTrim(A))). Further complexity is possible by nesting logical expressions by using IF, AND, NOT, and OR. Magic xpa removes any superfluous parentheses.

You can enter any arithmetic expression that follows conventional algebraic rules, or a string or a logical expression.

A function usually contains one or more arguments, delimited by commas. The argument list is enclosed in parentheses. Even if the function contains no arguments it still requires a set of parentheses: for example, Date ().

Every function returns a value.

The function names in expressions are not case sensitive.

Syntax Check

To check the syntax of the expression that you are working on, press the Tab key.

While in Wide mode (F6), to check the syntax of the expression, press Ctrl+Enter or go to the Edit menu and select Confirm Expression.

Wrap

When you select the Word Wrap option from the View menu or from the Expression Editor's context menu, every line that exceeds the line's displayed width is wrapped to the next line. The lines in the Expanded View are also wrapped.

Multiline Mode

You can expand the expression field so that the expression is displayed in a multi-line text area.

You can copy all or parts of the expanded text.

You can move to Multiline Field mode by:

  • Pressing F6

  • Exceeding the limit of the expression line

  • Pressing End for an expression that is too large to be displayed in regular mode.

Function Tooltip

This tooltip is active only when the expression entry is not in multi-line mode. When you have typed or selected an internal or user-defined function with parentheses, a tooltip appears just below the expression and displays that function’s parameters. When you have completed the function’s syntax, the tooltip disappears. The tooltip also displays the attribute type the function returns.

To open the tooltip manually, press Ctrl+Shift+Spacebar after the function’s left parenthesis.

The tooltip closes when you press Esc or when the tooltip time has expired, as defined in the Tooltip Timeout environment entry.

For user-defined functions, if Magic xpa is unable to determine the return value, the tooltip displays, “Returns Variant”.

Related Topics

Reference
Attachment 
Attachment