-
Notifications
You must be signed in to change notification settings - Fork 19
/
AMDSqlite3.pas
82 lines (71 loc) · 1.76 KB
/
AMDSqlite3.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{$I asqlite_def.inc}
unit AMDSqlite3;
interface
uses
Windows, Messages, SysUtils,
{$IFDEF ASQLITE_D6PLUS}
Variants,
{$ENDIF}
Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TFMD = class(TForm)
LBMaster: TListBox;
LBDetail: TListBox;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
LBLinked: TListBox;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label3: TLabel;
BitBtn5: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FMD: TFMD;
implementation
{$R *.dfm}
procedure TFMD.BitBtn1Click(Sender: TObject);
var TheStr : string;
i : integer;
begin
if (LBDetail.ItemIndex < 0) or (LBMaster.ItemIndex < 0) then exit;
TheStr := LBDetail.Items[LBDetail.ItemIndex]+'='+ LBMaster.Items[LBMaster.ItemIndex];
for i := 0 to LBLinked.Items.Count - 1 do
if CompareText(TheStr, LBLinked.Items[0])=0 then exit;
LBLinked.Items.Add(TheStr);
end;
procedure TFMD.BitBtn2Click(Sender: TObject);
{$IFNDEF ASQLITE_D6PLUS}
var i : integer;
{$ENDIF}
begin
{$IFDEF ASQLITE_D6PLUS}
LBLinked.DeleteSelected;
{$ELSE}
i := 0;
while i < LBLinked.Items.Count - 1 do begin
end;
{$ENDIF}
end;
procedure TFMD.BitBtn5Click(Sender: TObject);
var i, j : integer;
begin
for i := 0 to LBDetail.Items.Count - 1 do begin
LBDetail.ItemIndex := i;
for j := 0 to LBMaster.Items.Count - 1 do begin
LBMaster.ItemIndex := j;
if CompareText(LBDetail.Items[i], LBMaster.Items[j])=0 then
BitBtn1Click(Sender);
end;
end;
end;
end.