[Lazarus] Passing a section of an array to a function.

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Mon Sep 10 12:06:14 CEST 2012

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 of the
>> 32nd byte using "@buf[32]"
>> Or use the array slicing construct:
>> func(buf[32 .. <Last index of the array>]);
>> 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.

:-) Wasn't there something in PL/1 that allowed a skewed slice of a 2-D 
array to be passed as a 1-D parameter?

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list