Real Primary

<real primary>

──┬─ <real constant> ───────────────┬──────────────────────────────────┤
  ├─ <real constant identifier> ────┤
  ├─ <real identifier> ─────────────┤
  ├─ <hex function> ────────────────┤
  ├─ <octal function> ──────────────┤
  ├─ <real file attribute primary> ─┤
  ├─ <real task attribute primary> ─┤
  ├─ <integer primary> ─────────────┤
  └─ ( ── <real expression> ── ) ───┘

Explanation

Syntax for real constants, real constant identifiers, and real identifiers is provided in Basic Constructs. The syntax for an integer primary is given earlier in this section, and the other real primaries are defined in the following topics.

HEX Function

<hex function>

── HEX ── ( ── <string expression> ── ) ───────────────────────────────┤

Explanation

The HEX function returns a real value equal to the hexadecimal (base 16) number represented by the value of the string expression. The string expression must contain at least 1 and not more than 12 characters. All characters in the value of the string expression must be within the set of characters “0123456789ABCDEF”. A runtime error occurs if the string expression does not satisfy these requirements.

Examples

The following examples are HEX functions:

HEX("10") % YIELDS 16 (DECIMAL)
HEX("FF") % YIELDS 255 (DECIMAL)

OCTAL Function

<octal function>

── OCTAL ── ( ── <string expression> ── ) ─────────────────────────────┤

Explanation

The OCTAL function returns a real value equal to the octal (base 8) number represented by the value of the string expression. The string expression must contain at least 1 and not more than 16 characters. All characters in the value of the expression must be within the set of characters “01234567”. A runtime error occurs if the string expression does not satisfy these requirements.

Examples

The following examples illustrate OCTAL functions:

OCTAL("10") % YIELDS 8 (DECIMAL)

OCTAL("377") % YIELDS 255 (DECIMAL)

Real File Attribute Primary

<real file attribute primary>

── <file identifier> ── ( ── <real file attribute> ── ) ───────────────┤

Explanation

The real file attribute primary returns the value of a real file attribute associated with the specified file.

Real Task Attribute Primary

<real task attribute primary>

── <task identifier> ── ( ── <real task attribute> ── ) ───────────────┤

Explanation

The real task attribute primary returns the value of a real task attribute associated with the specified task variable.

Example

The following example illustrates a real task attribute primary:

RUN STAT/PROG [TV1];
RUN NEW/STAT/PROG [TV2];
IF TV2(ACCUMIOTIME) < TV1(ACCUMIOTIME) THEN
  DISPLAY"NEW FEATURE SAVES IO TIME"
ELSE
  DISPLAY"NEW FEATURE IS A FLOP";

In this example, real task attribute primaries are used to return the accumulated I/O time of two tasks.