
{: test that out of bounds array index causes a fatal error }

{$d+}
program d013( output );
type rind = 8..24;
var
   ar : array[rind] of real;
   k  : integer;

function side : integer;
begin
   side := k;
   k := k+1;
end;
begin {d013}
   k := 24;
   ar[side] := 6;
   if k <> 25 then
      writeln( 'side effect error evaluating array index' );

   k := 25;
   writeln( 'ar[', k:1, '] is ', ar[k]:1:1 );
end. { d013 }

