unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids;
type
tBuch =
Record
titel:
string[20];
autor:
string[20];
End;
tIndex =
Record index: integer;
End;
TForm1 =
class(TForm)
GroupBox1: TGroupBox;
Panel1: TPanel;
LabeledEdit_titel: TLabeledEdit;
LabeledEdit_autor: TLabeledEdit;
Button_save: TButton;
Button_list: TButton;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button_suche: TButton;
Button_entf: TButton;
StringGrid1: TStringGrid;
Label1: TLabel;
Button_titel: TButton;
Button_autor: TButton;
procedure Button_closeClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button_saveClick(Sender: TObject);
procedure Button_listClick(Sender: TObject);
procedure Button_sucheClick(Sender: TObject);
procedure Button_entfClick(Sender: TObject);
procedure Button_titelClick(Sender: TObject);
procedure Button_autorClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
datei:
file of tBuch;
datensatz: tBuch;
titel,autor:
file of tIndex;
dsTitel,dsAutor: tIndex;
implementation
{$R *.dfm}
....
procedure TForm1.FormCreate(Sender: TObject);
begin
assignfile(datei,'
daten.dat');
IF not fileexists('
G:\Borland\Delphi6\Projects\Buecher\daten.dat')
THEN rewrite(datei)
ELSE reset(datei);
assignfile(titel,'
titel.dat');
IF not fileexists('
G:\Borland\Delphi6\Projects\Buecher\titel.dat')
THEN rewrite(titel)
ELSE reset(titel);
assignfile(autor,'
autor.dat');
IF not fileexists('
G:\Borland\Delphi6\Projects\Buecher\autor.dat')
THEN rewrite(autor)
ELSE reset(autor);
Form1.StringGrid1.Cells[0,0]:='
Titel';
Form1.StringGrid1.Cells[1,0]:='
Autor';
end;