Previous Topic Next topic Print topic


ALLOCATION Function

Purpose

Returns a fixed-point binary integer that is the number of existing generations of a controlled variable.

Syntax

ALLOCATION (x)

Abbreviation(s): ALLOCN for ALLOCATION.

Parameters

x is a controlled variable.

Description

The ALLOCATION function returns a fixed-point binary integer that is the number of existing generations of a specified controlled variable. If x is not currently allocated, the result is zero.

Examples

DECLARE INPUT CHAR(10) CONTROLLED, 
   A CHAR(3) VARYING;
      .
      .
      .
      DO UNTIL (INPUT = 'STOP');
            ALLOCATE INPUT;
            GET LIST (INPUT);
               .
               .
               .
            END;
   A = ALLOCATION(INPUT);
   PUT SKIP LIST('Generations = ', A);

Restrictions

None.

Previous Topic Next topic Print topic