Hi and greetings...

Hi and greetings...
I am making a function which takes array of const as one of the parameters, just like Delphi's famous Format function. How to determine the data type of each of the array of const parameter? Thank you very much.

Comments

  1. myfunc(const Values: array of const);
    var index: integer;
    begin
    for Index := Low(Values) to High(Values) do
      WriteLn(TVarData(Values[Index]).VType);

    or

    case TVarData(Values[Index]).VType of
       varInteger: WriteLn(index, ': integer');
       varDouble: WriteLn(index, ': double);
     //...
    end;

    ReplyDelete

Post a Comment