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

Sven Barth pascaldragon at googlemail.com
Mon Sep 10 14:29:14 CEST 2012


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 .. <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.
>
> 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 now I know what the corresponding code in the parser is 
for :P )

Regards,
Sven





More information about the Lazarus mailing list