Hello,
I'm using objects in my project to perform some specific tasks needed. I have several of them, declared in a similar way with no visible mistakes at least for me. But at 3 of those objects I get an error while compiling:
unit1.pas(2895,21) Error: overloaded identifier "chkrelaypv" isn't a function
unit1.pas(2895,21) Error: function header doesn't match any method of this class freshairs.chkrelaypv$2895(var LongInt);"
heatingup=object
openIP,openOID,closeIP,closeOID:string;
openhe:procedure(var heati:integer);
closehe:procedure(var heati:integer);
chkrelayhe:procedure(var heati:integer);
end;
heater:array[1..11] of heatingup;
heatcount:array[1..11] of integer;
heatres:array[1..11] of string;
procedure heatingup.openhe(var heati:integer);
begin
if SNMPGet(heater[heati].closeOID, 'public', heater[heati].closeIP, heatres[heati]) then
if heatres[heati] = '1' then
begin
if SNMPSet(heater[heati].closeOID, 'private', heater[heati].closeIP, '0', 2) then
heatled[heati,2].color:=clGreen else heatled[heati,2].color:=clLime;
end;
if SNMPGet(heater[heati].openOID, 'public', heater[heati].openIP, heatres[heati]) then
if heatres[heati] = '0' then
begin
if SNMPSet(heater[heati].openOID, 'private', heater[heati].openIP, '0', 2) then
heatled[heati,1].color:=clLime else heatled[heati,1].color:=clGreen;
end;
end;
procedure heatingup.closehe(var heati:integer);
begin
if SNMPGet(heater[heati].openOID, 'public', heater[heati].openIP, heatres[heati]) then
if heatres[heati] = '1' then
begin
if SNMPSet(heater[heati].openOID, 'private', heater[heati].openIP, '0', 2) then
heatled[heati,1].color:=clGreen else heatled[heati,1].color:=clLIme;
end;
if SNMPGet(heater[heati].closeOID, 'public', heater[heati].closeIP, heatres[heati]) then
if heatres[heati] = '0' then
begin
if SNMPSet(heater[heati].closeOID, 'private', heater[heati].closeIP, '0', 2) then
heatled[heati,2].color:=clLime else heatled[heati,2].color:=clGreen;
end;
end;
procedure heatingup.chkrelayhe(var heati:integer);
begin
if SNMPGet(heater[heati].openOID, 'public', heater[heati].openIP, heatres[heati]) then
if heatres[heati] = '1' then heatled[heati,1].color:=clLime else heatled[heati,1].color:=clGreen;
if SNMPGet(heater[heati].closeOID, 'public', heater[heati].closeIP, heatres[heati]) then
if heatres[heati] = '1' then heatled[heati,2].color:=clLime else heatled[heati,2].color:=clGreen;
end;
I get the error on the line with the procedure header. I have checked for variables with the same name as one of the procedures but there is nothing present at the moment. There was one in an older version of the project and the project has got "cleansed" many times after that. Is there a mistake in my code or what am I supposed to do to make it work?
This is more or