Hi, This below seems to work.. I got the impression you couldn't do this.

program HelloWorld;

var
  I : Integer;

procedure test (args : array of const);
begin
 writeln('test');

  For i:=0 to High(Args) do
  begin
    case Args[i].vtype of
      vtstring:
        Writeln ('String value: ',args[i].vSTRING^);
      vtinteger:
        Writeln ('Integer value: ',args[i].vINTEGER);
    end;
  end;

end;


begin
  test([1, 'test']); // variable types work
  readln;
end.

In other words you can reinvent your own writeln style procedures and pass
parameters of *different types* simutaneously. I was under the impression you
could only pass parameters of the same type through this [] square bracket
trickery.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to