[fpc-pascal]Dynamic Variables
Brad Campbell
brad at seme.com.au
Fri Aug 31 11:08:47 CEST 2001
Michael Van Canneyt wrote:
>
> It depends. If you're using the 1.1 compiler, the best way is to
> use dynamic arrays:
>
> Type
> TheRec = Record
> A : String[80];
> B : Cardinal;
> End;
>
> Var
> DynArray : array of TTheRec; // No length specified
>
> Begin
> SetLength(DynArray,30);
> DynArray[1].A := 'Hello';
> DynArray[2].B := 42;
> End; // Compiler disposes of dynarray by itself.
>
> For version 1.0 I would use the objfpc way, as it resembles more the dynamic
> array method.
>
> Michael.
Problem being, it will not let me use the objfpc way with mode delphi..
I use that where I can, but some of my software needs delphi mode set,
though I can't remember why for the moment..
--
Brad....
/"\
Save the Forests \ / ASCII RIBBON CAMPAIGN
Burn a Greenie. X AGAINST HTML MAIL
/ \
More information about the fpc-pascal
mailing list