next up previous contents index
Next: StrPos Up: Functions and procedures. Previous: StrPas

StrPCopy

   

Declaration:

Function StrPCopy (Dest : PChar; Const Source : String) : PChar;

Description:

Converts the Pascal string in Source to a Null-terminated string, and copies it to Dest. Dest needs enough room to contain the string Source, i.e. Length(Source)+1 bytes.

Errors:

No length checking is performed.

See also:

StrPas

Example
Program Example2;

Uses strings;

{ Program to demonstrate the StrPCopy function. }

Const S = 'This is a normal string.';

Var P : Pchar;

begin
  p:=StrAlloc (length(S)+1);
  if StrPCopy (P,S)<>P then 
    Writeln ('This is impossible !!')
  else
    writeln (P);
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998