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

leledumbo leledumbo_cool at yahoo.co.id
Mon Sep 10 10:39:29 CEST 2012

> 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

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Passing-a-section-of-an-array-to-a-function-tp4026434p4026438.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

More information about the Lazarus mailing list