Here we give a list of things which are possible in Free Pascal, but which didn't exist in Turbo Pascal or Delphi.
function a : longint;
begin
a:=12;
while a>4 do
begin
{...}
end;
end;
The example above would work with TP, but the compiler would assume
that the a>4 is a recursive call. To do a recursive call in
this you must append () behind the function name:
function a : longint;
begin
a:=12;
{ this is the recursive call }
if a()>4 then
begin
{...}
end;
end;function a : longint;
begin
a:=12;
if a>4 then
begin
exit(a*67); {function result upon exit is a*67 }
end;
end;procedure DoSomething (a : longint);
begin
{...}
end;
procedure DoSomething (a : real);
begin
{...}
end;
You can then call procedure DoSomething with an argument of type
Longint or Real.procedure x (v : longint); forward;
{...}
procedure x;{ This will overload the previously declared x}
begin
{...}
end;
This construction will generate a compiler error, because the compiler
didn't find a definition of procedure x (v : longint);. Instead you
should define your procedure x as:
procedure x (v : longint);
{ This correctly defines the previously declared x}
begin
{...}
end;