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

« back to all changes in this revision

Viewing changes to fpcdocs/objectex/ex31.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 ex31;
 
2
 
 
3
{ Program to demonstrate the TCollection.Delete method }
 
4
 
 
5
Uses Objects,MyObject; { For TMyObject definition and registration }
 
6
 
 
7
Var C : PCollection;
 
8
    M : PMyObject;
 
9
    I : Longint;
 
10
 
 
11
begin
 
12
  Randomize;
 
13
  C:=New(PCollection,Init(120,10));
 
14
  For I:=1 to 100 do
 
15
    begin
 
16
    M:=New(PMyObject,Init);
 
17
    M^.SetField(I-1);
 
18
    C^.Insert(M);
 
19
    end;
 
20
  Writeln ('Added 100 Items.');
 
21
  With C^ do
 
22
    While Count>0 do Delete(At(Count-1));
 
23
  Writeln ('Freed all objects');
 
24
  Dispose(C,Done);
 
25
end.
 
 
b'\\ No newline at end of file'