Pascal Scripting: FmtMessage

Prototype:

function FmtMessage(const S: String; const Args: array of String): String;

Description:

Formats the string S using the specified string arguments. A %1 in the format string will be replaced with the first value in the Args array; a %2 will be replaced with the second value; and so on. %% will be replaced with %.

Remarks:

If a %-specifier references a non-existing argument, it will be returned untouched. No exception will be raised.

Example:
var
  S: String;
begin
  S := FmtMessage('%1 version %2 will be installed.', ['My Program', '1.0']);
  // S = 'My Program version 1.0 will be installed.'

  S := FmtMessage(SetupMessage(msgNotOnThisPlatform), ['Windows 2000']);
  // S = 'This program will not run on Windows 2000.'
end;