4.1. Guidelines for Simple Named Expressions

A named expression is simply an expression or part of an expression that can be given a name in order to save typing and to reduce typing errors.

  1. The syntax to surround a named expression is $ExpressionName$.

Example

Expression

Saved as

Insertion Syntax

Order Card

OC

$OC$

Note: The $name$ syntax works just like an #include directive in the “C” programming language. The $name$ is removed; the text it represents is inserted; the expression evaluation continues.

  1. A partial identifier or a partial literal will not work as a named expression.

Example

Assume

Order Card is an attribute group.

The following expression is invalid:

Given

O =

Order

C =

Card

This will not work because the group name is split in half.

$O$ $C$.A=’xyz’ fails.

A single token in the bnf syntax in the detail design is the smallest an expression can be.

Fractional tokens as demonstrated in this example are not supported.

  1. No substitution occurs between quotes.

The following expression is invalid:

Given:

val=

xyz

Order Card.A=’$val$’ fails.

The following expression is valid.

Given:

“val=’xyz’”

“Order Card.A=$val$“ succeeds.

  1. Expressions are context sensitive.

More information

4. Named Query expressions.