Sign in Join
FPDoc Onlineexperiment

StrLCopy function

In unit sysutils

Copy a null-terminated string, limited in length.

Declaration

pascal
function StrLCopy(dest: PAnsiChar; source: PAnsiChar; maxlen: SizeInt)
: PAnsiChar; overload

Description

Copies MaxLen characters from Source to Dest, and makes Dest a null terminated string.

Errors

No length checking is performed.

See also

Example: ex5

pascal
Program Example5;

Uses strings;

{ Program to demonstrate the StrLCopy function. }

Const P : PCHar = '123456789ABCDEF';

var PP : PCHar;

begin
  PP:=StrAlloc(11);
  Writeln ('First 10 characters of P : ',StrLCopy (PP,P,10));
  StrDispose(PP);
end.

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