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

« back to all changes in this revision

Viewing changes to docs/objectex/ex29.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 ex29;
2
 
 
3
 
{
4
 
 Program to demonstrate the TCollection.DeleteAll method 
5
 
 Compare with example 28, where FreeAll is used.
6
 
}
7
 
 
8
 
Uses Objects,MyObject; { For TMyObject definition and registration }
9
 
 
10
 
Var C : PCollection;
11
 
    M : PMyObject;
12
 
    I,InitMem : Longint;
13
 
 
14
 
begin
15
 
  Randomize;
16
 
  C:=New(PCollection,Init(120,10));
17
 
  InitMem:=Memavail;
18
 
  Writeln ('Initial memory : ',InitMem);
19
 
  For I:=1 to 100 do
20
 
    begin
21
 
    M:=New(PMyObject,Init);
22
 
    M^.SetField(I-1);
23
 
    C^.Insert(M);
24
 
    end;
25
 
  Writeln ('Added 100 Items. Memory available : ',Memavail);
26
 
  Write ('Lost : ',Initmem-Memavail,' bytes.');
27
 
  Write   ('(Should be 100*',SizeOF(TMyObject));
28
 
  Writeln ('=',100*SizeOf(TMyObject),')');
29
 
  C^.DeleteAll;
30
 
  Writeln ('Deleted all objects. Memory available : ',Memavail);
31
 
  Writeln ('Lost : ',Initmem-Memavail,' bytes.');
32
 
  Dispose(C,Done);
33
 
end.
 
 
b'\\ No newline at end of file'