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
|
public
{ Déclarations publiques }
var indexlig: integer;
end;
var
FDetail: TFDetail;
implementation
uses Modif;
{$R *.dfm}
procedure TFDetail.FormCreate(Sender: TObject);
var enregvin: vin;
adr: string;
fichier: file of vin;
col,i,lig : integer;
index:array[0..17,0..200] of integer;
ta:array[0..17] of integer;
begin
adr:= ExtractFilePath(Application.ExeName) + 'FichCave.vin';
grille.ColWidths[0]:=105;grille.Cells[0,0]:='APPELATION';
grille.ColWidths[1]:=105;grille.Cells[1,0]:='VIGNOBLE';
grille.ColWidths[2]:=105;grille.Cells[2,0]:='PRODUCTEUR';
grille.ColWidths[3]:=50; grille.Cells[3,0]:='TYPE';
grille.ColWidths[4]:=80;grille.Cells[4,0]:='Date achat';
grille.ColWidths[5]:=50;grille.Cells[5,0]:='PRIX achat';
grille.ColWidths[6]:=30;grille.Cells[6,0]:='QT';
grille.ColWidths[7]:=80;grille.Cells[7,0]:='MILLESIME';
grille.ColWidths[8]:=50;grille.Cells[8,0]:='A CONSO';
grille.ColWidths[9]:=50;grille.Cells[9,0]:='PRIX actuel';
origine.Text:=Cave.indexorigine;
if FileExists(adr) then
begin
AssignFile(fichier,adr);
Reset(fichier);
lig:=0;
while not eof(fichier) do
begin
read(fichier,enregvin);
if enregvin.origine=Cave.indexorigine then
begin
lig:=lig+1;col:=0;
grille.Cells[col,lig]:=enregvin.appelation; col:=col+1;
grille.Cells[col,lig]:=enregvin.vignoble; col:=col+1;
end;
end;
end;
indexlig:=grille.Row;
test.Text:=IntToStr(indexlig);
end;
procedure TFDetail.BTmodifClick(Sender: TObject);
begin
indexlig:=grille.row;
FModif.show;
end; |
Partager