function myFunc(a: array of const): string;
var
i: integer;
begin
for i := Low(a) to High(a) do
case a[i].VType of
0:
begin
result := Result + ' ' + Format('%d', a[i]);
end;
1:
Result := Result + ' ' + 'boolea';
11:
Result := Result + ' ' + format('%s', a[i]);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(myFunc([22, 55, True]));
end;
可变类型开放数组Demo
最新推荐文章于 2022-01-20 06:13:13 发布