Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-01

Populate the Format function

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joao Morais

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.

Thanks.

Joao Morais

Reply by email

Michael Van Canneyt
to Joao Morais
Joao Morais wrote 7 lines
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.

Reply by email