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

« back to all changes in this revision

Viewing changes to fpcsrc/packages/fcl-db/src/memds/testpop.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
{
 
2
    This file is part of the Free Component Library (FCL)
 
3
    Copyright (c) 1999-2000 by the Free Pascal development team
 
4
 
 
5
    See the file COPYING.FPC, included in this distribution,
 
6
    for details about the copyright.
 
7
 
 
8
    This program is distributed in the hope that it will be useful,
 
9
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
11
 
 
12
 **********************************************************************}
 
13
{$mode objfpc}
 
14
{$h+}
 
15
 
 
16
program testpop;
 
17
 
 
18
uses db,memds,classes,sysutils;
 
19
 
 
20
Procedure DoTest;
 
21
 
 
22
var
 
23
  I,ACount : integer;
 
24
  D   : TDateTime;
 
25
 
 
26
begin
 
27
  with TMemDataset.Create(Nil) do
 
28
    Try
 
29
      With FieldDefs do
 
30
        begin
 
31
        Clear;
 
32
        Add('Boolean', ftBoolean, 0, False);
 
33
        Add('Integer', ftInteger, 0, False);
 
34
        Add('SmallInt', ftSmallInt, 0, False);
 
35
        Add('Float', ftFloat, 0, False);
 
36
        Add('String', ftString, 30, False);
 
37
        Add('Time', ftTime, 0, False);
 
38
        Add('Date', ftDate, 0, False);
 
39
        end;
 
40
      CreateTable;
 
41
      Open;
 
42
      D:=now;
 
43
      ACount:=1000;
 
44
      for I:=1 to ACount do
 
45
        begin
 
46
        Append;
 
47
        FieldByName('Boolean').AsBoolean:=False;
 
48
        FieldByName('Integer').AsInteger:=I;
 
49
        FieldByName('SmallInt').AsInteger:=I;
 
50
        FieldByName('Float').AsFloat:=I/10;
 
51
        FieldByName('String').AsString:='Test-Data '+IntToStr(I);
 
52
        FieldByName('Time').AsDateTime:=D;
 
53
        FieldByName('Date').AsDateTime:=D;
 
54
        Post;
 
55
        end;
 
56
      First;
 
57
      ACount:=0;
 
58
      While Not EOF do
 
59
        begin
 
60
        Inc(ACount);
 
61
        Writeln('Record ',ACount,' : ');
 
62
        Writeln('------------------------');
 
63
        For I:=0 to Fields.Count-1 do
 
64
          Writeln(Fields[I].FieldName,' : ',Fields[I].AsString);
 
65
        Writeln;
 
66
        Next;
 
67
        end;
 
68
      Writeln('Total data size : ',DataSize);
 
69
      If (ParamCount>0) then
 
70
        FileName:=ParamStr(1);
 
71
      Close;
 
72
  finally
 
73
    Free;
 
74
  end;
 
75
end;
 
76
 
 
77
begin
 
78
  DoTest;
 
79
end.