RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.StrLFmt Function

Formats a series of arguments from a specified open array into a buffer.

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

StrLFmt formats the series of arguments in and open array and writes the results to a buffer. 

Buffer is the buffer that receives the results. 

MaxLen is the maximum number of bytes that can be written to Buffer. This value does not include the terminating null character. 

Format is the format string that governs the operation. 

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

Note: Args_Size is the index of the last argument in Args (one less than the number of arguments).
StrLFmt returns a pointer to the destination buffer. 

The first form of StrLFmt is not thread-safe, because it uses localization information contained in global variables. The second form of StrLFmt, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of StrLFmt, 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!