summaryrefslogtreecommitdiff
path: root/fpcdocs/stringex/ex11.pp
blob: 8130b5e62428b1a491439992ffddee1f3388e854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Program Example11;

Uses strings;

{ Program to demonstrate the StrCat function. }

Const P1 : PChar = 'This is a PChar String.';

Var P2 : PChar;

begin
  P2:=StrAlloc (StrLen(P1)*2+1);
  StrMove (P2,P1,StrLen(P1)+1); { P2=P1 }
  StrCat (P2,P1);               { Append P2 once more }
  Writeln ('P2 : ',P2);
  StrDispose(P2);
end.