Forum > General

Error with overloaded method

(1/1)

Neuromancer:
Hello,

I wrote the following class with an overloaded procedure :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---TSerialSizer = class(TInterfacedObject, ISerializer)    protected        FLength : Integer;    public        constructor Create;        procedure IO(AValue : PChar); overload;        procedure IO(AValue : PSmallInt); overload;        procedure IO(AValue : PInteger); overload;        procedure IO(AValue : PString); overload;        function GetLength : Integer;    end;

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TSerialSizer.IO(AValue : PString);begin    IO(FLength);    Inc(FLength, Length(AValue^));end;
I get the following error :

--- Quote ---/home/jerome/Projects/pascal/mylibs/serialization/serialsizer.pas(52,15) Error: Incompatible type for arg no. 1: Got "LongInt", expected "PString"
--- End quote ---

marcov:
You pass flength, which is integer and there is no overload for integer, so what do you exactly expect ?

Navigation

[0] Message Index

Go to full version