tr (Now) + ' - Розрахунок зроблений. Максимальний СвОЦВОР '+ floattostr (max) +' руб. у '+ sg1.cells [0, l]);
end;
procedure TForm1.Button6Click (Sender: TObject);
var n: longint;
begin
with savedialog1 do begin
title: = 'Збереження бази';
if execute then
begin
filenamezap: = filename;
assignfile (filezap, filenamezap);
rewrite (filezap);
n: = 0;
repeat
Mzap [n]. prod: ='';
Mzap [n]. onng: = 0;
Mzap [n]. plan: = 0;
Mzap [n]. onkg: = 0;
Mzap [n]. svocep: = 0;
n: = n +1;
until n> = 200;
n: = 1;
repeat
if sg1.Cells [0, n] <>'' then begin
Mzap [n]. prod: = sg1.Cells [0, n];
Mzap [n]. onng: = strtoint (sg1.cells [1, n]);
Mzap [n]. plan: = strtoint (sg1.cells [2, n]);
Mzap [n]. onkg: = strtoint (sg1.cells [3, n]);
Mzap [n]. svocep: = strtofloat (sg1.cells [5, n]);
end;
n: = n +1;
until n> = sg1.RowCount;
for n: = 1 to 100 do write (filezap, mzap [n]);
closefile (filezap);
end;
end;
memo1.Lines.Insert (0, DateTimeToStr (Now) + ' - База збережена під ім'ям '+ filenamezap);
end;
rocedure TForm1.Button5Click (Sender: TObject);
var n, k: longint;
begin
with opendialog1 do begin
title: = 'Відкриття бази';
if execute then
begin
filenamezap: = filename;
assignfile (filezap, filenamezap);
reset (filezap);
n: = 0;
repeat
Mzap [n]. prod: ='';
Mzap [n]. onng: = 0;
Mzap [n]. plan: = 0;
Mzap [n]. onkg: = 0;
Mzap [n]. svocep: = 0;
n: = n +1;
until n> = 200;
n: = 1;
while not eof (filezap) do
begin
read (filezap, mzap [n]);
n: = n +1;
end;
cleansg (sender);
n: = 0; k: = 1;
repeat
if Mzap [n]. prod <>'' then begin
sg1.Cells [0, k]: = Mzap [n]. prod;
sg1.Cells [1, k]: = inttostr (Mzap [n]. onng);
sg1.Cells [2, k]: = inttostr (Mzap [n]. plan);
sg1.Cells [3, k]: = inttostr (Mzap [n]. onkg);
sg1.Cells [+5, k]: = floattostr (Mzap [n]. svocep),
k: = k +1;
end;
n: = n +1;
until n> = 200;
autorachet (sender);
end;
end;
memo1.Lines.Insert (0, DateTimeToStr (Now) + ' - База '+ filenamezap +' відкрита ');
end;
// процедура видалення запису
procedure TForm1.Button3Click (Sender: TObject);
var n, k: longint;
begin
sg1.Rows [sg1.Row]. Clear;
n: = 0;
repeat
Mzap [n]. prod: ='';
Mzap [n]. onng: = 0;
Mzap [n]. plan: = 0;
Mzap [n]. onkg: = 0;
Mzap [n]. svocep: = 0;
n: = n +1;
until n> = 200;
n: = 1;
repeat
if sg1.Cells [0, n] <>'' then begin
Mzap [n]. prod: = sg1.Cells [0, n];
Mzap [n]. onng: = strtoint (sg1.cells [1, n]);
Mzap [n]. plan: = strtoint (sg1.cells [2, n]);
Mzap [n]. onkg: = strtoint (sg1.cells [3, n]);
Mzap [n]. svocep: = strtofloat (sg1.cells [5, n]);
end;
n: = n +1;
until n> = sg1.RowCount;
cleansg (sender);
n: = 0; k: = 1;
repeat
if Mzap [n]. prod <>'' then begin
sg1.Cells [0, k]: = Mzap [n]. prod;
sg1.Cells [1, k]: = inttostr (Mzap [n]. onng);
sg1.Cells [2, k]: = inttostr (Mzap [n]. plan);
sg1.Cells [3, k]: = inttostr (Mzap [n]. onkg);
sg1.Cells [5, k]: = floattostr (Mzap [n]. svocep);
k: = k +1;
cleanedit (Sender),// ​​виклик очищення Єдитів
end;
n: = n +1;
until n> = 200;
autorachet (sender),
end;
procedure TForm1.sg1Click (Sender: TObject);
begin
edit1.Text: = sg1.Cells [0, sg1.Row];
edit2.Text: = sg1.Cells [1, sg1.Row];
edit3.Text: = sg1.Cells [2, sg1.Row];
edit4.Text: = sg1.Cells [3, sg1.Row];
edit5.Text: = sg1.Cells [5, sg1.Row];
memo1.Lines.Insert (0, DateTimeToStr (Now) + ' - Запис № '+ inttostr (sg1.Row) +' обрана ');
end;
procedure TForm1.N8Click (Sender: TObject);
begin
ShellExecute (form1.Handle, nil, PChar ('mailto: ultrix@tut.by? Subject = EcoInfo'),'','', 0);
end;
procedure TForm1.N5Click (Sender: TObject);
begin
halt;
end;
end.