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

Howard Page-Clark hdpc at talktalk.net
Mon Sep 10 10:20:04 CEST 2012


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: integer;
> begin
>    i:=1;
>    if (cbuf[0]and $F0)=$20 then
>    begin
>      Inc(i,2);
>      len:=cbuf[i]and $7;
>    end;
>    ...
> end;

There is no looping construct (while or repeat) in your decompress_r 
procedure.

Howard





More information about the Lazarus mailing list