Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Menu;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
- type
- TMenuForm = class(TForm)
- GetData: TButton;
- ConnectFile: TButton;
- OpenDialog1: TOpenDialog;
- procedure GetDataClick(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure ConnectFileClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- TRef = Record
- Topic: String[25];
- Author: String[20];
- Str: Integer;
- Date: String[10];
- End;
- var
- MenuForm: TMenuForm;
- Ref: array of TRef;
- MyFile: File of TRef;
- n: Integer;
- implementation
- Uses
- Base, ChangeMenu, Add, DeleteRef, Change;
- {$R *.dfm}
- procedure TMenuForm.GetDataClick(Sender: TObject);
- begin
- BaseForm.Show;
- MenuForm.Hide;
- end;
- procedure TMenuForm.ConnectFileClick(Sender: TObject);
- var
- i: Integer;
- begin
- i := 0;
- if OpenDialog1.Execute then
- begin
- AssignFile(MyFile, OpenDialog1.FileName);
- Reset(MyFile);
- SetLength(Ref, FileSize(MyFile));
- While not eof(MyFile) do
- begin
- Read(MyFile, Ref[i]);
- Inc(i);
- end;
- n := i;
- end;
- GetData.Enabled := True;
- end;
- procedure TMenuForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- begin
- MenuForm.Close;
- ChangeMenuForm.Close;
- AddForm.Close;
- DeleteForm.Close;
- ChangeForm.Close;
- end;
- procedure TMenuForm.FormCreate(Sender: TObject);
- begin
- n := 0;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement