~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fpcdocs/stringex/ex11.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program Example11;
 
2
 
 
3
Uses strings;
 
4
 
 
5
{ Program to demonstrate the StrCat function. }
 
6
 
 
7
Const P1 : PChar = 'This is a PChar String.';
 
8
 
 
9
Var P2 : PChar;
 
10
 
 
11
begin
 
12
  P2:=StrAlloc (StrLen(P1)*2+1);
 
13
  StrMove (P2,P1,StrLen(P1)+1); { P2=P1 }
 
14
  StrCat (P2,P1);               { Append P2 once more }
 
15
  Writeln ('P2 : ',P2);
 
16
  StrDispose(P2);
 
17
end.