Arithmetic Primaries

<arithmetic primary>

──┬─<unsigned number>────────────────────────────────────┬─────────────┤
  ├─<arithmetic concatenation expression>────────────────┤
  ├─<string literal>─────────────────────────────────────┤
  ├─<arithmetic variable>── := ──<arithmetic expression>─┤
  └─<arithmetic operand>─┬───────────────────────────────┤
                         └─<partial word part>───────────┘

<arithmetic operand>

──┬─<arithmetic variable>─┬──────────────────┬─────────────────────────┤
  │                       └─<update symbols>─┤
  ├─<arithmetic function designator>─────────┤
  ├─ ( ──<arithmetic expression>── ) ────────┤
  ├─<arithmetic case expression>─────────────┤
  └─<arithmetic attribute>───────────────────┘

<arithmetic case expression>

                   ┌◄─────────── , ──────────┐
──<case head>── ( ─┴─<arithmetic expression>─┴─ ) ─────────────────────┤

<conditional arithmetic expression>

──<if clause>──<arithmetic expression>── ELSE ─────────────────────────►
►─<arithmetic expression>──────────────────────────────────────────────┤

<constant arithmetic expression>

An arithmetic expression that can be fully evaluated at compilation time.

The items on which arithmetic operators act are called arithmetic primaries.

A variable or function designator used as an arithmetic primary in an arithmetic expression must be of an arithmetic type: INTEGER, REAL, DINTEGER, or DOUBLE.

An attribute used as an arithmetic primary must have a type that is INTEGER, REAL, DINTEGER, or DOUBLE. For information on file attribute and direct array attribute types, see the File Attributes Programming Reference Manual. The arithmetic-valued task attributes are described in “Arithmetic Assignment” in Statements.

The length of a string literal used as an arithmetic primary must not exceed 48 bits. A string literal used as an arithmetic primary is interpreted as either type REAL or type INTEGER, depending on its value.

The arithmetic concatenation expression is described in Concatenation Expression.

The partial word part is described in Partial Word Expression.

The evaluation of an arithmetic case expression is described in Case Expression.

Examples of Arithmetic Primaries

Valid

Invalid

5.678

Y.[30:4]

X:= *:= Y

X:= * + 3

"ABCD"

+ DC8

(14 + 3.142)

SQRT(X)

B –A

MABEL

CASE I OF (5,15,17)

–(A + B)

R & 3 [1:2]

FYLE.MAXRECSIZE

TRUE