title: How do I build an array of const?
body: <p>I am implementing an interpreter, and one of the functions my interpreter will support is like Delphi's <code>Format</code>. In fact, I'm implementing my function using <code>SysUtils.Format</code>. However, I'm having trouble building the second parameter to the function, the <code>array of TVarRec</code>.</p>
  
  <p>Suppose I have the following code. For now, I just assume which Delphi variables the interpreted code will need access to (<code>iVar1</code> and <code>iVar2</code>), but I still don't know how to put them into the structure that <code>Format</code> requires (<code>arFormatArgs</code>).</p>
  
  <pre><code>type TFormatArgs = array of TVarRec;
  
  procedure RunInterpretedFormatFunction;
  var
    iMyAge: integer;
    iMyIQ: integer;
    sCode: string;
    sText: string;
  begin
    iMyAge := 5;
    iMyIQ := -5;
    sCode := 'Format(''My age is %d and my IQ is %d'', [iMyAge, iMyIQ])';
    sText := FormatThis(sCode, iMyAge, iMyIQ);
  end;
  
  function FormatThis(sFormatCode: string; iVar1: integer; iVar2: integer): string;
  var
    sFormatString: string;
    arFormatArgs: TFormatArgs;
  begin
    sFormatString := GetFormatString(sFormatCode); // I can implement this function
    arFormatArgs := ConstructFormatArgs(iVar1, iVar2); // NEED HELP HERE!
    result := SysUtils.Format(sFormatString, arFormatArgs);
  end;
  </code></pre>
  
  <p>How can I implement my <code>ConstructFormatArgs</code> function in Delphi (not Assembly)?</p>