[fpc-pascal] Populate the Format function

Michael Van Canneyt michael at freepascal.org
Wed Jan 23 09:16:31 CET 2008



On Tue, 22 Jan 2008, Joao Morais wrote:

> 
> Hello,
> 
> I need to send an unknown amount of elements to the Format function (actually
> objects within a tlist decendant). I apparently cannot create a dynamic array
> of const, is there another way that I am missing? Currently I am parsing the
> Fmt param.

Sure you can create one. Array of const is just an array of TVarRec. Just
create a dynamical array of TVarRec and pass that.

{$mode objfpc}
program tests;

uses sysutils;

Var
  A : Array of TVarRec;

begin
  SetLength(A,10);
  // Fill A;
  Format('Something',A);
end.

Michael.



More information about the fpc-pascal mailing list