Sign in Join
FPDoc Onlineexperiment

FormatBuf function

In unit sysutils

Format a string with given arguments and store the result in a buffer.

Declaration

pascal
function FormatBuf(var Buffer; BufLen: Cardinal; const Fmt; 
 fmtLen: Cardinal; const Args: Array of const)
: Cardinal

Description

FormatBuf calls Format and stores the result in Buf.

See also

Example: ex72

pascal
Program Example72;

{ This program demonstrates the FormatBuf function }

Uses sysutils;

Var
  S : ShortString;

Const
  Fmt : ShortString =  'For some nice examples of fomatting see %s.';

Begin
  S:='';
  SetLength(S,FormatBuf (S[1],255,Fmt[1],Length(Fmt),['Format']));
  Writeln (S);
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.