On Mon, Sep 10, 2012 at 02:29:14PM +0200, Sven Barth wrote:
> > The delphi compatible way is slice, but ti was only documented after the
> > last release:
> >
> > http://bugs.freepascal.org/view.php?id=22681
>
> I did know about Slice, but not about the possiblity to use ranges
> directly (and no
Am 10.09.2012 13:21, schrieb Marco van de Voort:
On Mon, Sep 10, 2012 at 10:47:33AM +0200, Sven Barth wrote:
func(buf[32 .. ]);
reference: http://www.freepascal.org/docs-html/ref/refsu59.html
And it's still true: even I as a compiler developer can learn something
new as I didn't know yet that
On Mon, Sep 10, 2012 at 10:47:33AM +0200, Sven Barth wrote:
> >
> > func(buf[32 .. ]);
> > reference: http://www.freepascal.org/docs-html/ref/refsu59.html
>
> And it's still true: even I as a compiler developer can learn something
> new as I didn't know yet that this was possible.
The delphi com
Sven Barth wrote:
Am 10.09.2012 10:39, schrieb leledumbo:
If you know the amount of bytes you
want to copy then you should use "Copy(buf, 32, count)" as argument for
decompress_r or if you don't know the amount you should change your
function from "array of Byte" to "PByte" and pass the address
On 10 September 2012 10:14, Sven Barth wrote:
> Did you really write "&"? The address operator is "@", but this won't make
> your code work anyway. If you did indeed write "&" (which is for escaping
> keywords) you do indeed only pass the 32nd element to your function.
:blush:
I did indeed. That
Am 10.09.2012 10:39, schrieb leledumbo:
If you know the amount of bytes you
want to copy then you should use "Copy(buf, 32, count)" as argument for
decompress_r or if you don't know the amount you should change your
function from "array of Byte" to "PByte" and pass the address of the
32nd byte u
yte using "@buf[32]"
Or use the array slicing construct:
func(buf[32 .. ]);
reference: http://www.freepascal.org/docs-html/ref/refsu59.html
--
View this message in context:
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Passing-a-section-of-an-array-to-a-function-tp4026434p
On 10/9/12 7:36, Dave Coventry wrote:
Hi,
I have an array of Byte which I have loaded from a file.
I want to process a 100 byte section of the array which starts at
offset 32 in my array.
My function (or procedure) is as follows:
procedure decompress_r(cbuf: array of byte);
var
len,i: inte
Am 10.09.2012 08:36, schrieb Dave Coventry:
Hi,
I have an array of Byte which I have loaded from a file.
I want to process a 100 byte section of the array which starts at
offset 32 in my array.
My function (or procedure) is as follows:
procedure decompress_r(cbuf: array of byte);
var
len,i
Hi,
I have an array of Byte which I have loaded from a file.
I want to process a 100 byte section of the array which starts at
offset 32 in my array.
My function (or procedure) is as follows:
procedure decompress_r(cbuf: array of byte);
var
len,i: integer;
begin
i:=1;
if (cbuf[0]and $F0)=
10 matches
Mail list logo