Home
 

Error Checking

Error Checking

Array indices must start at 1. An error is raised if it is not.

The upper array bound may not be lower then the lower array bound.

Multiple declaration of variables raises an error.

Using an undeclared variable raises an error.

Minimal type checking is done. You cannot use array subscripts for simple types, eg the following raises an "Type and reference mismatch" error.

program wrong;
  var a: integer;
begin
    a[2] := 25;
end.
Note: Using too few subscripts does not lead to an error. Instead the first element of the array is referenced (just as in the bash-shell).