Delphi 使用变量数组格式化?

Delphi 使用变量数组格式化?,delphi,delphi-xe,variant,Delphi,Delphi Xe,Variant,如何将格式与变量数组一起使用?我有一个例外,它应该单独存储消息和参数,以便在顶层进行翻译: TMyException = class (Exception) private FParams : array of Variant; public constructor Create (const Msg : String); constructor CreateFmt (const Msg : String; Args : array of Variant); end; 现在,我以后

如何将
格式
变量
数组一起使用?我有一个例外,它应该单独存储消息和参数,以便在顶层进行翻译:

TMyException = class (Exception)
private
  FParams : array of Variant;
public
  constructor Create (const Msg : String);
  constructor CreateFmt (const Msg : String; Args : array of Variant);
end;

现在,我以后如何对存储的值使用
格式

Format和similor使用的const数组实际上是一个开放的const数组。虽然表面上与变种相似,但TVarRec是一种不同的野兽。我推荐Rudy Velthuis出色地解释了复制和操作TVarRec数组所需的一些细节。

您需要的是TVarRec而不是变体:@David:再次感谢!回答这个问题,我会接受的。