[fpc-pascal] Class helper method overloading ?

LacaK lacak at zoznam.sk
Wed Oct 12 13:16:26 CEST 2016


Hi,

is there posibility introduce in class helper method with same name like 
in base class ?

For example:

TSQLQueryHelper = class helper for TSQLQuery
   public
     procedure ExecSQL(const ASQL: string; const Args: array of const); 
overload;
end;

procedure TSQLQueryHelper.ExecSQL(const ASQL: string; const Args: array 
of const);
begin
   SQL.Text := Format(ASQL, Args);
   ExecSQL; // here I want call ExecSQL of TSQLQuery, but compiler 
complains about wrong number of parameters
end;

When I use:
   inherited ExecSQL;

it compiles (and why is there need to use "inherited", when I use 
overload and there exists method ExecSQL without parameters?)

, but later I get again error "Wrong number of parameters specified for 
call to "ExecSQL"",
when I want use ExecSQL('',[]) in instance of TSQLQuery

Thanks

-Laco.




More information about the fpc-pascal mailing list