HP 3000 Manuals

Arrays and Array Items [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation


HP ALLBASE/BRW Reference Manual

Arrays and Array Items 

An array is a combination of one or more items of the same type.  Each
item in an array (also called a component of an array) is treated exactly
like a normal item.  Arrays are defined in a data dictionary; you can
manipulate but not create arrays in HP ALLBASE/BRW.

Characteristics 

Arrays have these characteristics: 

   *   Each array item is referenced by the array name followed by an
       index in parentheses, as shown here:

       TURNOVER(4)

       This will reference the fourth item (or component) of the array
       TURNOVER.

       TURNOVER ((MONTH + 4) / 2)

       This will reference the item whose index is the result of the
       expression MONTH + 4 / 2.

   *   As with items, if the array name is not unique, it can be preceded
       by the source table name followed by a period; for example:

       CUSTOMERS.TURNOVER(?MONTH)

       This will reference the item in the array TURNOVER (in source
       table CUSTOMERS) whose index is equal to the value of the
       parameter ?MONTH.

   *   The first array component has an index of 1.

   *   If no index is specified, the first array component is selected.
       That is, if you specify TURNOVER (in a calculation or in a
       lineset) without an index, the value of TURNOVER (1)is used in the
       calculation (or is printed).

   *   If the index points to an array component that does not exist (for
       example, an array TURNOVER has 12 components, and the array item
       is TURN OVER(13)), an INDEXVIOLATION occurs.  See "Exception
       Handling" later in this chapter.

   *   The array index must be of the type Integer.

   *   Array components can be of any HP ALLBASE/BRW type (so long as all
       the components of an array are the same type) that is; Numeric,
       Real, Integer, String, Date, or Time.  They behave exactly as
       normal items of their type.  For example, they have a single value
       per record, and so on.

   *   Arrays are usually referenced by component; only on the Project
       Items and Output File screens do you refer to an entire array.

       HP ALLBASE/BRW makes no distinction between normal items and array
       items.  (To HP ALLBASE/BRW, a normal item is an array with one
       component.)

Related Sections 

   *   Arguments

   *   Aggregate/Array Operations

   *   Calculation Language

   *   Naming Conventions



MPE/iX 5.0 Documentation