When you compile a program with the -Mtp switch, the compiler will attempt to mimic the Turbo Pascal compiler in the following ways:
Procedure a (L : Longint); Forward;
...
Procedure a ; { No need to repeat the (L : Longint) }
begin
...
end;
Function expr : Longint;
begin
...
Expr:=L:
Writeln (Expr);
...
end;
In Turbo Pascal compatibility mode, the function will be called recursively when the writeln statement is processed. In Free Pascal, the function result will be printed. In order to call the function recursively under Free Pascal, you need to implement it as follows :
Function expr : Longint;
begin
...
Expr:=L:
Writeln (Expr());
...
end;
a: Procedure;
b: Pointer;
begin
b := a; // Error will be generated.
Remark The MemAvail and MaxAvail functions are no longer available in Free Pascal as of version 2.0. The reason for this incompatibility follows:
On modern operating systems, 1 the idea of ”Available Free Memory” is not valid for an application. The reasons are:
Therefore, programs using MemAvail and MaxAvail functions should be rewritten so they no longer use these functions, because it does not make sense any more on modern OS’es. There are 3 possibilities:
1The DOS extender GO32V2 falls under this definition of ”modern” because it can use paged memory and run in multitasked environments.