How to debug Pascal runtime error?

520 views Asked by At

I have a Pascal program built with TMT compiler that runs on Windows 95. Sometimes it fails with a runtime error like:

Error 207 at <adress>

I would like to at least determine where the error actually occured.

1

There are 1 answers

0
Caleb Adams On BEST ANSWER

Error 207 is generally an Invalid floating point operation. This is the case in both free pascal and TMT's framework pascal.

Sometimes this occurs when you do not return a value from your functions. Try checking that you assign return values in functions like these:

function yourFunction(x:real) : real;
var
  someValue : real;
begin
  someValue := 42;
  yourFunction := someValue;
end;

In this case you should make sure that you are assigning your return

yourFunction := someValue;

A 207 error gennerally means that you have some variable that hasn't been initialized properly.