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

« back to all changes in this revision

Viewing changes to docs/objectex/ex22.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 ex22;
2
 
 
3
 
{ Program to demonstrate the TCollection.Load method }
4
 
 
5
 
Uses Objects,MyObject; { For TMyObject definition and registration }
6
 
 
7
 
Var C : PCollection;
8
 
    M : PMyObject;
9
 
    I : Longint;
10
 
    S : PMemoryStream;
11
 
 
12
 
begin
13
 
  C:=New(PCollection,Init(100,10));
14
 
  For I:=1 to 100 do
15
 
    begin
16
 
    M:=New(PMyObject,Init);
17
 
    M^.SetField(100-I);
18
 
    C^.Insert(M);
19
 
    end;
20
 
  Writeln ('Inserted ',C^.Count,' objects');
21
 
  S:=New(PMemorySTream,Init(1000,10));
22
 
  C^.Store(S^);
23
 
  C^.FreeAll;
24
 
  Dispose(C,Done);
25
 
  S^.Seek(0);
26
 
  C^.Load(S^);
27
 
  Writeln ('Read ',C^.Count,' objects from stream.');
28
 
  Dispose(S,Done);
29
 
  Dispose(C,Done);
30
 
end.
 
 
b'\\ No newline at end of file'