[Lazarus] Got "Pointer", expected "Open Array Of Char"

Howard Page-Clark hdpc at talktalk.net
Sat Jan 12 17:58:21 CET 2013


On 12/1/13 6:10, Dave Coventry wrote:

> dst and src are passed to the function that calls Copybytes();
>
> function copy_compressed_bytes(var dst: array of Char; var dloc, sloc:
> integer; src: array of Char;
>    len: integer): integer;
> begin
>    Copybytes(@dst[dloc], at src[sloc],16);
>    return 0;
> end;

I think making src also a var parameter and structuring the signatures 
for the routines without @ as follows will work:

procedure Copybytes(var dst, src: array of Char; len: integer);
...

function copy_compressed_bytes(var dst: array of Char;
                                var dloc, sloc:integer;
                                src: array of Char;
                                len: integer): integer;
begin
   Copybytes(dst[dloc],src[sloc],16);
   Exit(0);
end;





More information about the Lazarus mailing list