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

« back to all changes in this revision

Viewing changes to fpcdocs/sysutex/ex56.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 Example56;
 
2
 
 
3
{ This program demonstrates the AnsiStrLComp function }
 
4
 
 
5
Uses sysutils;
 
6
 
 
7
Procedure TestIt (S1,S2 : Pchar; L : longint);
 
8
 
 
9
Var R : Longint;
 
10
 
 
11
begin
 
12
  R:=AnsiStrLComp(S1,S2,L);
 
13
  Write ('First ',L,' characters of "',S1,'" are ');
 
14
  If R<0 then
 
15
    write ('less than ')
 
16
  else If R=0 then
 
17
    Write ('equal to ')
 
18
  else
 
19
    Write ('larger than ');
 
20
  Writeln ('those of "',S2,'"');
 
21
end;
 
22
 
 
23
Begin
 
24
  Testit('One string','One smaller string',255);
 
25
  Testit('One string','One String',4);
 
26
  Testit('One string','1 string',0);
 
27
  Testit('One string','One string.',9);
 
28
End.
 
 
b'\\ No newline at end of file'