[fpc-pascal]'try-except'-problem

Dominik Schulz dschulz at c-nit.de
Fri Sep 15 22:39:07 CEST 2000


Hi!

I'm new to Free Pascal an Object Pascal. So I tried the following
program:
-----------------------
program testtry;
{$mode objfpc}
{$I-} //I'm not really sure whether this switch is usefull here.
uses crt;

var a, b : word;

begin
  writeln('start');
  a :=  1;
  b :=  a - 1;
  try
    a := 1 div b;
  except
    writeln('Error');
  end;

  writeln('end');
end.
-----------------------

This program always crashes with RE 200.
Why doesn't the try-except-block avoid this?

Thank you in advance!

                        ciao, Dominik





More information about the fpc-pascal mailing list