[fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Jul 17 08:06:13 CEST 2015


On 2015-07-17 03:34, silvioprog wrote:
> TPersonDao = class(TObject)
> public
>   procedure Save(APerson: TObject);
> end;

Simply change that to the following:

TPersonDao = class(TObject)
public
  procedure Save(APerson: TPerson);
end;

and you could have compile time validation too. Using TObject as the
parameter type is just too generic (excuse the pun). ;-)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/



More information about the fpc-pascal mailing list