RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.StrFmt Function

Formats entries in an array.

Pascal
function StrFmt(Buffer: PAnsiChar; Format: PAnsiChar; const Args: array of const): PAnsiChar; overload;
function StrFmt(Buffer: PAnsiChar; Format: PAnsiChar; const Args: array of const; const FormatSettings: TFormatSettings): PAnsiChar; overload;
function StrFmt(Buffer: PWideChar; Format: PWideChar; const Args: array of const): PWideChar; overload;
function StrFmt(Buffer: PWideChar; Format: PWideChar; const Args: array of const; const FormatSettings: TFormatSettings): PWideChar; overload;
C++
PAnsiChar StrFmt(PAnsiChar Buffer, PAnsiChar Format, const array of const Args);
PAnsiChar StrFmt(PAnsiChar Buffer, PAnsiChar Format, const array of const Args, const TFormatSettings FormatSettings);
PWideChar StrFmt(PWideChar Buffer, PWideChar Format, const array of const Args);
PWideChar StrFmt(PWideChar Buffer, PWideChar Format, const array of const Args, const TFormatSettings FormatSettings);

StrFmt formats the series of arguments from an open array into a buffer. 

Buffer is a buffer that receives the results. 

Format is a null-terminated format string that indicates how to generate the results. For more information about how the result is formatted, see Format Strings. 

Args is an array of arguments that replace the format specifiers in Format.

Note: Args_Size gives the index of the last argument (one less than the number of elements in Args).
StrFmt returns a pointer to the destination buffer. 

The first form of StrFmt is not thread-safe, because it uses localization information contained in global variables. The second form of StrFmt, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of StrFmt, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!