~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcdocs/refex/ex101.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program Example101;
 
2
 
 
3
{ Program to demonstrate the CompareDWord function. }
 
4
 
 
5
Const
 
6
  ArraySize     = 100;
 
7
  HalfArraySize = ArraySize Div 2;
 
8
 
 
9
Var
 
10
  Buf1,Buf2 : Array[1..ArraySize] of Dword;
 
11
  I : longint;
 
12
 
 
13
  Procedure CheckPos(Len : Longint);
 
14
 
 
15
  Begin
 
16
    Write('First ',Len,' DWords are ');
 
17
    if CompareDWord(Buf1,Buf2,Len)<>0 then
 
18
      Write('NOT ');
 
19
    Writeln('equal');
 
20
  end;
 
21
 
 
22
 
 
23
begin
 
24
  For I:=1 to ArraySize do
 
25
    begin
 
26
    Buf1[i]:=I;
 
27
    If I<=HalfArraySize Then
 
28
      Buf2[I]:=I
 
29
    else
 
30
      Buf2[i]:=HalfArraySize-I;
 
31
    end;
 
32
  CheckPos(HalfArraySize div 2);
 
33
  CheckPos(HalfArraySize);
 
34
  CheckPos(HalfArraySize+1);
 
35
  CheckPos(HalfArraySize + HalfArraySize Div 2);
 
36
end.