Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Перевалов Р.О. Записка к курсовой.docx
Скачиваний:
3
Добавлен:
26.09.2019
Размер:
380.91 Кб
Скачать

Список использованной литературы

1. Программирование. Файлы Pascal-Паскаль http://www.pascal.helpov.net

2. Технология работы с файлами в системе Delphi http://www.delphi-manual.ru

3. Учебник Delphi - Библия Delphi http://amberv.narod.ru/delphi.html

Листинг программы

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Edit3: TEdit;

Edit4: TEdit;

Button1: TButton;

Button2: TButton;

Button3: TButton;

Button4: TButton;

Button5: TButton;

Button6: TButton;

Button7: TButton;

Button8: TButton;

Button11: TButton;

Button12: TButton;

Button13: TButton;

Label5: TLabel;

Edit5: TEdit;

Label6: TLabel;

ComboBox1: TComboBox;

procedure Button1Click(Sender: TObject);

procedure Button6Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button7Click(Sender: TObject);

procedure Button5Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure Button12Click(Sender: TObject);

procedure Button11Click(Sender: TObject);

procedure Button13Click(Sender: TObject);

procedure view;

procedure view2;

procedure view3;

procedure view4;

procedure view5;

procedure view6;

procedure view7;

procedure Button8Click(Sender: TObject);

procedure ComboBox1Change(Sender: TObject);

end;

{ private

{ Private declarations

public

{ Public declarations

end; }

type

monitor = record

vid: string[30];

diagonal: string[30];

ugol: string[30];

color: string[30];

firma: string[10];

end;

mouse = record

vid: string[30];

technologia: string[30];

color: string[30];

firma: string[10];

end;

keyboard = record

vid: string[30];

color: string[30];

firma: string[10];

end;

printer = record

vid: string[30];

cvet: string[30];

color: string[30];

firma: string[10];

end;

scaner = record

razreshenie: string[30];

color: string[30];

firma: string[10];

end;

speakers = record

moshnost: string[30];

kol: string[30];

color: string[30];

firma: string[10];

end;

UPS = record

volume: string[30];

color: string[30];

firma: string[10];

end;

var

Form1: TForm1;

f1: file of monitor;

f2: file of mouse;

f3: file of keyboard;

f4: file of printer;

f5: file of scaner;

f6: file of speakers;

f7: file of UPS;

Stud: monitor;

i, pos:integer;

x2: string[30];

flag: boolean;

mas:array[1..100] of monitor;

mas2:array[1..100] of mouse;

mas3:array[1..100] of keyboard;

mas4:array[1..100] of printer;

mas5:array[1..100] of scaner;

mas6:array[1..100] of speakers;

mas7:array[1..100] of ups;

max, curr: byte;

implementation

uses Unit2, Unit3, Unit4, Unit5;

{$R *.dfm}

procedure TForm1.view;

begin

Edit1.Text:=mas[curr].vid;

Edit2.Text:=mas[curr].diagonal;

Edit3.Text:=mas[curr].ugol;

Edit4.Text:=mas[curr].color;

Edit5.Text:=mas[curr].firma;

end;

procedure TForm1.view2;

begin

Edit1.Text:=mas2[curr].vid;

Edit2.Text:=mas2[curr].technologia;

Edit3.Text:=mas2[curr].color;

Edit4.Text:=mas2[curr].firma;

end;

procedure TForm1.view3;

begin

Edit1.Text:=mas3[curr].vid;

Edit2.Text:=mas3[curr].color;

Edit3.Text:=mas3[curr].firma;

end;

procedure TForm1.view4;

begin

Edit1.Text:=mas4[curr].vid;

Edit2.Text:=mas4[curr].cvet;

Edit3.Text:=mas4[curr].color;

Edit4.Text:=mas4[curr].firma;

end;

procedure TForm1.view5;

begin

Edit1.Text:=mas5[curr].razreshenie;

Edit2.Text:=mas5[curr].color;

Edit3.Text:=mas5[curr].firma;

end;

procedure TForm1.view6;

begin

Edit1.Text:=mas6[curr].moshnost;

Edit2.Text:=mas6[curr].kol;

Edit3.Text:=mas6[curr].color;

Edit4.Text:=mas6[curr].firma;

end;

procedure TForm1.view7;

begin

Edit1.Text:=mas7[curr].volume;

Edit2.Text:=mas7[curr].color;

Edit3.Text:=mas7[curr].firma;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

close;

end;

procedure TForm1.Button6Click(Sender: TObject);

var i:integer;

begin

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

assignfile(f1, 'Base\monitor.pro');

rewrite(f1);

for i:=1 to max do

begin

write(f1, mas[i]);

end;

closefile(f1);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

assignfile(f2, 'Base\mouse.pro');

rewrite(f2);

for i:=1 to max do

begin

write(f2, mas2[i]);

end;

closefile(f2);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

assignfile(f3, 'Base\keyboard.pro');

rewrite(f3);

for i:=1 to max do

begin

write(f3, mas3[i]);

end;

closefile(f3);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

assignfile(f4, 'Base\printer.pro');

rewrite(f4);

for i:=1 to max do

begin

write(f4, mas4[i]);

end;

closefile(f4);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

assignfile(f5, 'Base\scaner.pro');

rewrite(f5);

for i:=1 to max do

begin

write(f5, mas5[i]);

end;

closefile(f5);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

assignfile(f6, 'Base\speakers.pro');

rewrite(f6);

for i:=1 to max do

begin

write(f6, mas6[i]);

end;

closefile(f6);

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

assignfile(f7, 'Base\ups.pro');

rewrite(f7);

for i:=1 to max do

begin

write(f7, mas7[i]);

end;

closefile(f7);

end;

Form5. ShowModal;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

curr:=1;

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

view;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

view2;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

view3;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

view4;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

view5;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

view6;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

view7;

end;

end;

procedure TForm1.Button7Click(Sender: TObject);

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

curr:=max+1;

max:=curr;

Edit1.enabled:=true;

Edit2.enabled:=true;

Edit3.enabled:=true;

Edit4.enabled:=true;

Edit5.enabled:=true;

button2.Enabled:=false;

button3.Enabled:=false;

button4.Enabled:=false;

button5.Enabled:=false;

button6.Enabled:=false;

button7.Enabled:=false;

button8.Enabled:=false;

button11.Enabled:=false;

button12.Enabled:=true;

button13.Enabled:=true;

end;

procedure TForm1.Button5Click(Sender: TObject);

begin

curr:=max;

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

view;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

view2;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

view3;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

view4;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

view5;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

view6;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

view7;

end;

end;

procedure TForm1.Button3Click(Sender: TObject);

begin

if curr>1

then

begin

curr:=curr-1;

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

view;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

view2;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

view3;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

view4;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

view5;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

view6;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

view7;

end;

end;

end;

procedure TForm1.Button4Click(Sender: TObject);

begin

if curr<max

then

begin

curr:=curr+1;

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

view;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

view2;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

view3;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

view4;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

view5;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

view6;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

view7;

end;

end;

end;

procedure TForm1.FormCreate(Sender: TObject);

var FileHandle:integer; //объявляем переменную

begin

pos:=0;

max:=0;

curr:=0;

if DirectoryExists('Base')=false then

begin

CreateDir('Base'); // создаём папку Base

{создаём в папке файлы и закрываем их}

FileHandle:=FileCreate('Base\monitor.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\mouse.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\keyboard.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\printer.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\scaner.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\speakers.pro');

FileClose(FileHandle);

FileHandle:=FileCreate('Base\ups.pro');

FileClose(FileHandle);

end;

end;

procedure TForm1.Button12Click(Sender: TObject);

begin

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

mas[curr].vid:=Edit1.Text;

mas[curr].diagonal:=Edit2.Text;

mas[curr].ugol:=Edit3.Text;

mas[curr].color:=Edit4.Text;

mas[curr].firma:=Edit5.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

mas2[curr].vid:=Edit1.Text;

mas2[curr].technologia:=Edit2.Text;

mas2[curr].color:=Edit3.Text;

mas2[curr].firma:=Edit4.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

mas3[curr].vid:=Edit1.Text;

mas3[curr].color:=Edit2.Text;

mas3[curr].firma:=Edit3.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

mas4[curr].vid:=Edit1.Text;

mas4[curr].cvet:=Edit2.Text;

mas4[curr].color:=Edit3.Text;

mas4[curr].firma:=Edit4.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

mas5[curr].razreshenie:=Edit1.Text;

mas5[curr].color:=Edit2.Text;

mas5[curr].firma:=Edit3.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

mas6[curr].moshnost:=Edit1.Text;

mas6[curr].kol:=Edit2.Text;

mas6[curr].color:=Edit3.Text;

mas6[curr].firma:=Edit4.Text;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

mas7[curr].volume:=Edit1.Text;

mas7[curr].color:=Edit2.Text;

mas7[curr].firma:=Edit3.Text;

end;

Edit1.enabled:=false;

Edit2.enabled:=false;

Edit3.enabled:=false;

Edit4.enabled:=false;

Edit5.enabled:=false;

button12.Enabled:=false;

button13.Enabled:=false;

button2.Enabled:=true;

button3.Enabled:=true;

button4.Enabled:=true;

button5.Enabled:=true;

button6.Enabled:=true;

button7.Enabled:=true;

button8.Enabled:=true;

button11.Enabled:=true;

end;

procedure TForm1.Button11Click(Sender: TObject);

begin

Edit1.enabled:=true;

Edit2.enabled:=true;

Edit3.enabled:=true;

Edit4.enabled:=true;

Edit5.enabled:=true;

button2.Enabled:=false;

button3.Enabled:=false;

button4.Enabled:=false;

button5.Enabled:=false;

button7.Enabled:=false;

button8.Enabled:=false;

button11.Enabled:=false;

button12.Enabled:=true;

button13.Enabled:=true;

end;

procedure TForm1.Button13Click(Sender: TObject);

begin

curr:=max-1;

max:=curr;

Edit1.enabled:=false;

Edit2.enabled:=false;

Edit3.enabled:=false;

Edit4.enabled:=false;

Edit5.enabled:=false;

button12.Enabled:=false;

button13.Enabled:=false;

button2.Enabled:=true;

button3.Enabled:=true;

button4.Enabled:=true;

button5.Enabled:=true;

button6.Enabled:=true;

button7.Enabled:=true;

button8.Enabled:=true;

button11.Enabled:=true;

end;

procedure TForm1.Button8Click(Sender: TObject);

begin

flag:=false;

Form4. ShowModal;

if flag=true

then

begin

curr:=1;

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

view;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

view2;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

view3;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

view4;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

view5;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

view6;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

view7;

end;

end;

end;

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

x2:=ComboBox1.Items.Strings [ComboBox1.ItemIndex];

if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Монитор' then

begin

Label1.Caption:='Вид';

Label2.Caption:='Диагональ';

Label3.Caption:='Угол обзора';

Label4.Caption:='Цвет';

Label5.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=true;

Edit5.Visible:=true;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=true;

assignfile(f1, 'Base\monitor.pro');

reset(f1);

max:=0;

curr:=0;

i:=1;

while not EOF(f1) do

begin

read (f1, mas[i]);

max:=max+1;

i:=i+1;

end;

closefile(f1);

if max>=1

then

begin

curr:=1;

view;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Мышь' then

begin

Label1.Caption:='Вид';

Label2.Caption:='Технология';

Label3.Caption:='Цвет';

Label4.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=true;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=false;

assignfile(f2, 'Base\mouse.pro');

reset(f2);

max:=0;

curr:=0;

i:=1;

while not EOF(f2) do

begin

read (f2, mas2[i]);

max:=max+1;

i:=i+1;

end;

closefile(f2);

if max>=1

then

begin

curr:=1;

view2;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Клавиатура' then

begin

Label1.Caption:='Вид';

Label2.Caption:='Цвет';

Label3.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=false;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=false;

Label5.Visible:=false;

assignfile(f3, 'Base\keyboard.pro');

reset(f3);

max:=0;

curr:=0;

i:=1;

while not EOF(f3) do

begin

read (f3, mas3[i]);

max:=max+1;

i:=i+1;

end;

closefile(f3);

if max>=1

then

begin

curr:=1;

view3;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Принтер' then

begin

Label1.Caption:='Вид';

Label2.Caption:='Цветность';

Label3.Caption:='Цвет';

Label4.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=true;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=false;

assignfile(f4, 'Base\printer.pro');

reset(f4);

max:=0;

curr:=0;

i:=1;

while not EOF(f4) do

begin

read (f4, mas4[i]);

max:=max+1;

i:=i+1;

end;

closefile(f4);

if max>=1

then

begin

curr:=1;

view4;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Сканер' then

begin

Label1.Caption:='Разрешение';

Label2.Caption:='Цвет';

Label3.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=false;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=false;

Label5.Visible:=false;

assignfile(f5, 'Base\scaner.pro');

reset(f5);

max:=0;

curr:=0;

i:=1;

while not EOF(f5) do

begin

read (f5, mas5[i]);

max:=max+1;

i:=i+1;

end;

closefile(f5);

if max>=1

then

begin

curr:=1;

view5;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'Колонки' then

begin

Label1.Caption:='Мощность';

Label2.Caption:='Кол-во';

Label3.Caption:='Цвет';

Label4.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=true;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=false;

assignfile(f6, 'Base\speakers.pro');

reset(f6);

max:=0;

curr:=0;

i:=1;

while not EOF(f6) do

begin

read (f6, mas6[i]);

max:=max+1;

i:=i+1;

end;

closefile(f6);

if max>=1

then

begin

curr:=1;

view6;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end

else if ComboBox1.Items.Strings [ComboBox1.ItemIndex] = 'UPS' then

begin

Label1.Caption:='Время работы';

Label2.Caption:='Цвет';

Label3.Caption:='Фирма';

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

Edit4.Visible:=false;

Edit5.Visible:=false;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=false;

Label5.Visible:=false;

assignfile(f7, 'Base\ups.pro');

reset(f7);

max:=0;

curr:=0;

i:=1;

while not EOF(f7) do

begin

read (f7, mas7[i]);

max:=max+1;

i:=i+1;

end;

closefile(f7);

if max>=1

then

begin

curr:=1;

view7;

end

else

begin

Edit1.Text:='';

Edit2.Text:='';

Edit3.Text:='';

Edit4.Text:='';

Edit5.Text:='';

end;

end;

button2.Enabled:=true;

button3.Enabled:=true;

button4.Enabled:=true;

button5.Enabled:=true;

button6.Enabled:=true;

button7.Enabled:=true;

button8.Enabled:=true;

button11.Enabled:=true;

end;

end.

unit Unit4;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm4 = class(TForm)

Label1: TLabel;

Button1: TButton;

Button2: TButton;

procedure Button2Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

i:integer;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm4.Button2Click(Sender: TObject);

begin

ModalResult := mrOk;

end;

procedure TForm4.Button1Click(Sender: TObject);

begin

for i:=Unit1.curr to Unit1.max do

begin

if Unit1.x2 = 'Монитор' then

begin

Unit1.mas[i]:=Unit1.mas[i+1];

end

else if Unit1.x2 = 'Мышь' then

begin

Unit1.mas2[i]:=Unit1.mas2[i+1];

end

else if Unit1.x2 = 'Клавиатура' then

begin

Unit1.mas3[i]:=Unit1.mas3[i+1];

end

else if Unit1.x2 = 'Принтер' then

begin

Unit1.mas4[i]:=Unit1.mas4[i+1];

end

else if Unit1.x2 = 'Сканер' then

begin

Unit1.mas5[i]:=Unit1.mas5[i+1];

end

else if Unit1.x2 = 'Колонки' then

begin

Unit1.mas6[i]:=Unit1.mas6[i+1];

end

else if Unit1.x2 = 'UPS' then

begin

Unit1.mas7[i]:=Unit1.mas7[i+1];

end;

end;

Unit1.max:=Unit1.max-1;

Unit1.flag:=true;

ModalResult := mrOk;

end;

end.

unit Unit5;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm5 = class(TForm)

Button1: TButton;

Label1: TLabel;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

implementation

{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);

begin

ModalResult := mrOk;

end;

end.