Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Otchet_k_kursovoy.doc
Скачиваний:
6
Добавлен:
23.04.2019
Размер:
606.72 Кб
Скачать

2 Поиск

unit Unit2;

interface

uses

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

Dialogs, StdCtrls;

type

TForm2 = class(TForm)

Button1: TButton;

Edit1: TEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

Label11: TLabel;

Label12: TLabel;

Label13: TLabel;

Label14: TLabel;

Label15: TLabel;

Label16: TLabel;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

implementation

uses Unit1, Unit3;

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);

var fa:string;

i,z:integer;

begin

fa:=form3.edit1.text;

z:=0;

for i:=0 to form1.StringGrid1.RowCount-1 do begin

if

fa = form1.stringgrid1.Cells[1,i+1] then

begin

form2.Label8.caption:= form1.stringgrid1.Cells[1,i+1];

form2.Label9.caption:= form1.stringgrid1.Cells[2,i+1];

form2.Label10.caption:= form1.stringgrid1.Cells[3,i+1];

form2.Label11.caption:= form1.stringgrid1.Cells[4,i+1];

form2.Label12.caption:= form1.stringgrid1.Cells[5,i+1];

form2.Label16.caption:= form1.stringgrid1.Cells[6,i+1];

form2.Label17.caption:= form1.stringgrid1.Cells[7,i+1];

form2.Label18.caption:= form1.stringgrid1.Cells[8,i+1];

z:=1;

end;

end;

if z=0 then ShowMessage('Совпадений не найдено');

end;

end.

  1. Диаграмма

unit Unit3;

interface

uses

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

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Button1: TButton;

Edit1: TEdit;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

Label11: TLabel;

Label12: TLabel;

Label13: TLabel;

Label14: TLabel;

Label15: TLabel;

Label16: TLabel;

Label17: TLabel;

Label18: TLabel;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);

var

i:Integer;

begin

for i:=0 to Form1.StringGrid1.RowCount-1 do begin

if Form1.StringGrid1.Cells[3,1]='Бухгалтерия' then vr[1]:=strtoint(Form1.StringGrid1.Cells[4,1]);

if Form1.StringGrid1.Cells[3,2]='Бухгалтерия' then vr[2]:=strtoint(Form1.StringGrid1.Cells[4,2]);

if Form1.StringGrid1.Cells[3,3]='Бухгалтерия' then vr[3]:=strtoint(Form1.StringGrid1.Cells[4,3]);

end;

Chart1.Series[0].Add(vr[1],Form1.StringGrid1.Cells[2,1],RGB(random(255),random(255),random(255)));

Chart1.Series[0].Add(vr[2],Form1.StringGrid1.Cells[2,2],RGB(random(255),random(255),random(255)));

Chart1.Series[0].Add(vr[3],Form1.StringGrid1.Cells[2,3],RGB(random(255),random(255),random(255)));

end;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]