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

Dave Coventry dgcoventry at gmail.com
Sat Jan 12 07:10:44 CET 2013


Hi, thanks for the response.

On 12 January 2013 07:51, leledumbo <leledumbo_cool at yahoo.co.id> wrote:
> What's the type of dst and src that you pass to the function? Array is not
> pointer, and I have no idea about open array with var modifier. Open array
> is compatible with any array (and its subarrays through slicing).

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;

You may be onto something. dst is passed as a *var* because I'm
interested in the destination array but can discard the src after it's
been read.

I'll look into how the memory is allocated for src.

Many thanks.

Dave




More information about the Lazarus mailing list