[fpc-pascal] Freepascal 2.2.0 released

Marc Santhoff M.Santhoff at t-online.de
Tue Sep 11 16:49:45 CEST 2007


Am Dienstag, den 11.09.2007, 15:13 +0200 schrieb Daniƫl Mantione:

> > Can someone please give a short explanation of this item?:
> > 
> > >   * pointer[low..high] syntax to pass C-style pointer arrays to procedures
> > >     using open arrays
> 
> If you allocate dynamic sized structures using pointers it was previously 
> troublesome to pass this to open arrays, i.e. you can now do:
> 
> procedure abc(const x:array of byte);
> 
> begin
> end;
> 
> var b:Pbyte;
> 
> begin
>   abc(b[0..7]);
> end;
> 
> However, it also works with normal arrays (and strings) you you can now 
> pass partial arrays:
> 
> procedure abc(const x:array of byte);
> 
> begin
> end;
> 
> var b:array[0..15] of byte;
> 
> begin
>   abc(b[0..9]);
> end;

I see, pretty neat for handling array row-wise or the like, thanks.

Marc





More information about the fpc-pascal mailing list