[fpc-devel] TRegistry, TRegIniFile

Vincent Snijders vsnijders at quicknet.nl
Mon May 12 07:43:53 CEST 2008


Paul Ishenin schreef:
> Hello,  FPC developers' list.
> 
> Why
> 
> TRegistry = class(TObject)
> ...
> public
>   constructor Create; overload;
>   constructor Create(aaccess:longword); // <<-- no overload
> ...
> 
> TRegIniFile = class(TRegistry)
> ...
> public
>   constructor Create(const FN: string);  // <<-- no overload
>   constructor Create(const FN: string;aaccess:longword); overload;
> ...
> 
> Is this by design that 2 constructors miss "overload" keyword in the 
> declaration? Delphi has overload everywhere.

I guess overload can be removed.

> 
> I suppose this cause this code to fail with message:
> 
> [code]
> var
>   fReg: TRegIniFile;
> begin
>   fReg := TRegIniFile.Create;
> end;
> [/code]
> 
> [message]
> Error: Incompatible types: got "constructor TRegIniFile.Create(const 
> AnsiString)" expected "TRegIniFile"
> [/message]
> 

I don't think it will fail. Overload is not required in mode objfpc as 
it is in Delphi.

Vincent



More information about the fpc-devel mailing list