[fpc-pascal] declaration of functions
Sven Barth
pascaldragon at googlemail.com
Fri Oct 15 11:07:47 CEST 2010
Am 14.10.2010 14:50, schrieb Uffe Kousgaard:
> While trying to make delphi code compatible with FPC, I have hit this
> issue:
>
> Delphi allows:
>
> interface
> function somefunction(a: integer): integer;
>
> implementation
> function somefunction;
> begin
> result:= a*2;
> end;
>
> FPC requires the full declaration to be repeated. Can this be avoided
> somehow? I have many functions/procedures without full declaration in
> the implementation part.
Add
{$mode delphi}
at the top of your unit, then this "Delhpi compatible" syntax will be
enabled. The two default FPC modes (fpc and objfpc) are more strict than
the Delphi one.
Regards,
Sven
More information about the fpc-pascal
mailing list