System.AnsiStrings.FormatBuf

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function FormatBuf(var Buffer; BufLen: Cardinal; const Format;
FmtLen: Cardinal; const Args: array of const): Cardinal;
function FormatBuf(var Buffer; BufLen: Cardinal; const Format;
FmtLen: Cardinal; const Args: array of const;
const AFormatSettings: TFormatSettings): Cardinal;

C++

extern DELPHI_PACKAGE unsigned __fastcall FormatBuf(void *Buffer, unsigned BufLen, const void *Format, unsigned FmtLen, const System::TVarRec *Args, const System::NativeInt Args_High)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.AnsiStrings.pas
System.AnsiStrings.hpp
System.AnsiStrings System.AnsiStrings

Description

Formats the arguments from an array, placing the result in a buffer.

This function formats the series of arguments in the specified open array into a text buffer.

Buffer is the text buffer that receives the results.

BufLen is the number of bytes in Buffer.

Format is the format string that determines how arguments are formatted. For information on the format strings, see Format strings.

FmtLen is the number of bytes in Format.

Args are the arguments that replace the format specifiers in Format.

Note: Args_Size is the index of the last element in Args (one less than the number of arguments).

FormatBuf function returns the length, in bytes, of the resulting string.

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

See Also