Hello,
I am using Lazarus 2.08 on a Windows 10, 64bit os.
I keep getting the following error on compilation:
“Error: Overloaded functions have same parameter list”, followed by this:
“Error: Found declaration: Gammp(real, real): double;
this is on a function:
Function PgmName.Gammp(a, x : real) : real;
This compiled and executed ok on Delphi XE, and I know that is not a valid reason why it should work here. Is this because all of the declared variables in the program are typed as “double”, or is there another reason.
I would send the zipped file, but I do not know how to just zip one function from a project in Lazarus.
Here is the code for that function:
Function TFormMainErrorFunctionCalculator.Gammp(a, x : real) : real;
//
// Returns the incomplete GAMMA Function P(a,x);
//
var
//
gamser, gammcf, gln : real;
//
begin
//
If ( x < 0.0) or (a <= 0.0) then
begin
if MessageDlg('INVALID ARGUMENTS! Terminating Operation', mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then close;
end;
if x < a + 1.0 then
begin
gser(a, x, gamser, gln);
gammp := gamser
end
else begin
gcf(a, x, gammcf, gln);
gammp := 1.0 - gammcf
end
end;
It is called by several procedures in the project usually with call like this:
erf := gammp(0.5, sqr(x));
x is not a declared variable in my Var sections, but rather a result of other functions and is typed as “real”
Thank you for any insight you might be able to provide, I appreciate it very much.
John