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

2013-01-13 Thread Florian Klämpfl
leledumbo schrieb: >Actually, rather than continuing this, if what you need is only to copy >a >dynamic array then you can simply: > >dst := Copy(src,0,Length(src)); dst:=Copy(src); works as well. -- ___ Lazarus mailing list Lazarus@lists.lazar

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

2013-01-13 Thread Dave Coventry
On 13 January 2013 17:14, leledumbo wrote: > dst := Copy(src,0,Length(src)); Thank you. It's not quite that simple, but I'll bear that technique in mind. :+) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepas

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

2013-01-13 Thread leledumbo
Actually, rather than continuing this, if what you need is only to copy a dynamic array then you can simply: dst := Copy(src,0,Length(src)); -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Got-Pointer-expected-Open-Array-Of-Char-tp4028513p4028525.html

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

2013-01-13 Thread Howard Page-Clark
On 13/1/13 1:58, Dave Coventry wrote: On 13 January 2013 14:56, leledumbo wrote: Or const since it's meant to be read only Hmmm. Doesn't help. Still getting the same error. I've tried passing the src parameter as a Pointer and then casting it as an array of Char. procedure Copybytes(var ds

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

2013-01-13 Thread Dave Coventry
On 13 January 2013 14:56, leledumbo wrote: > Or const since it's meant to be read only Hmmm. Doesn't help. Still getting the same error. I've tried passing the src parameter as a Pointer and then casting it as an array of Char. procedure Copybytes(var dst: Pointer; src: Pointer; len: integer);

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

2013-01-13 Thread leledumbo
> I think making src also a var parameter... Or const since it's meant to be read only -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Got-Pointer-expected-Open-Array-Of-Char-tp4028513p4028521.html Sent from the Free Pascal - Lazarus mail

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

2013-01-12 Thread Howard Page-Clark
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],@src[sloc],16); return 0; end; I

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

2013-01-11 Thread Dave Coventry
Hi, thanks for the response. On 12 January 2013 07:51, leledumbo 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). ds

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

2013-01-11 Thread leledumbo
80.n3.nabble.com/Lazarus-Got-Pointer-expected-Open-Array-Of-Char-tp4028513p4028514.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/ma

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

2013-01-11 Thread Dave Coventry
Hi, I have a procedure defined as follows: procedure Copybytes(var dst: array of Char; src: array of Char; len: integer); If I call it using the following: Copybytes(@dst[dloc],@src[sloc],16); I get an error: dwg.pas(116,36) Error: Incompatible type for arg no. 2: Got "Pointer", expected "Ope