[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
array                    Declares an Array (List of Variables)

 type
   <tname>  = array[<ranges>] of <basetype>;

 var
   <vname>  : array[<ranges>] of <basetype>;

    Use this to declare arrays, which are indexable lists of variables.
    You can declare multi-dimensional arrays by listing multiple ranges.

         <tname>    name of data type being defined.

         <vname>    name of variable being declared.

      <basetype>    any Pascal data type or definition.

        <ranges>    one or more ranges, separated by commas, where each
                    range is either <subrange> or <otype>.

      <subrange>    <val1>..<val2>, where <val1> and <val2> are any two
                    values of an ordinal (Integer, Byte, Boolean, Char,
                    enumerated) data type. Both <val1> and <val2> must be
                    of the same data type.

         <otype>    The name of any ordinal data type except Integer; this
                    can include any enumerated data type you have
                    declared. This implies the subrange <OLow>..<OHigh>
                    where <OLow> is the lowest value of the ordinal type
                    and <OHigh> is the highest.

  -------------------------------- Example ---------------------------------

           type
             Scores   = array[1..5] of Real;
             Class    = array[1..100] of Scores;
           var
             CharFreq : array[Char] of Integer;
             Grid     : array[-10..10,-8..8] of Boolean;

See Also: arrays packed
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson