Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Pascal

Idiom #303 Array with non-default lower bound

Declare an array a of integers with six elements, where the first index is 42 and consecutive elements have the indices 43, 44, 45, 46, 47.

var
  a: array[42..47] of integer;

Low(a) returns 42 and High(a) returns 47
A : array (42 .. 47) of Integer;

A'First is 42, A'Last is 47, A'Length is 6.

New implementation...
< >
tkoenig