Sign in Join
FPDoc Onlineexperiment

StrLFmt function

In unit sysutils

Format a string with given arguments, but with limited length.

Declaration

pascal
function StrLFmt(Buffer: PChar; Maxlen: Cardinal; Fmt: PChar; 
 const args: Array of const): PChar

Description

StrLFmt will format fmt with Args, as the Format function does, and it will store maximally Maxlen characters of the result in Buffer. The function returns Buffer. Buffer should point to enough space to contain MaxLen characters.

Errors

for a list of errors, see Format.

See also

Example: ex81

pascal
Program Example80;

{ This program demonstrates the StrFmt function }

Uses sysutils;

Var S : AnsiString;

Begin
  SetLEngth(S,80);
  Writeln (StrLFmt (@S[1],80,'For some nice examples of fomatting see %s.',['Format']));
End.

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