Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TCreateRecord.SaveFileClick(Sender: TObject);
- type
- Product = record
- NameOfProduct, SortOfProduct , PriceOfProduct, Date: string[255];
- end;
- var
- FileF: file of Product;
- FileName: string;
- OneProduct: Product;
- i, j: Integer;
- begin
- if SaveFileDialog.Execute then
- begin
- FileName := SaveFileDialog.FileName;
- AssignFile(FileF, SaveFileDialog.FileName);
- Rewrite(FileF);
- with InputProduct do
- begin
- for i := 1 to RowCount do
- begin
- OneProduct.NameOfProduct := Cells[0, i];
- OneProduct.SortOfProduct := Cells[1, i];
- OneProduct.PriceOfProduct := Cells[2, i];
- OneProduct.Date := Cells[3, i];
- Write(FileF, OneProduct);
- end;
- end;
- CloseFile(FileF);
- ShowMessage('Данные успешно сохранены.');
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement