[fpc-pascal] Freepascal 2.2.0 released
Daniël Mantione
daniel.mantione at freepascal.org
Tue Sep 11 15:13:35 CEST 2007
Op Tue, 11 Sep 2007, schreef Marc Santhoff:
> Am Montag, den 10.09.2007, 12:56 +0200 schrieb Joost van der Sluis:
>
> Since this page isn't already up:
>
> > http://wiki.freepascal.org/User_Changes_2.2.0
>
> 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;
Daniël
More information about the fpc-pascal
mailing list