unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, sEdit, sLabel, sButton, sSkinProvider, sSkinManager;

type
  TForm2 = class(TForm)
    sLabel1: TsLabel;
    sLabel2: TsLabel;
    sEdit1: TsEdit;
    sEdit2: TsEdit;
    sButton1: TsButton;
    sEdit3: TsEdit;
    sLabel3: TsLabel;
    sButton2: TsButton;
    sLabel4: TsLabel;
    sLabel5: TsLabel;
    sSkinProvider1: TsSkinProvider;
    sSkinManager1: TsSkinManager;
    procedure sButton1Click(Sender: TObject);
    procedure sButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1, Unit3;

{$R *.dfm}

procedure TForm2.sButton1Click(Sender: TObject);
var
count, num, i:integer;
str: String;
begin
 try
 count:=strtoint(sedit3.Text);
 except
 on E: EConvertError do begin showmessage('Ошибка');exit;end;
 end;
If ((sedit1.Text='') or (sedit2.Text='') or (sedit3.Text='')) then showmessage('Заполните все поля.') else begin

for i:=1 to StrToInt(sedit3.Text)-1 do
begin randomize; str:=str+IntToStr(Random(600))+','; end;
str:='('+str+IntToStr(Random(600))+')';
//inittest(extractfilepath(paramstr(0))+'w.tst',count);

Form1.ADOQuery1.SQL.Text:='Select * From тест Where код in '+str;
Form1.ADOQuery1.Open;

form1.ShowModal;
end;
end;

procedure TForm2.sButton2Click(Sender: TObject);
begin
Form3.showmodal;
end;

end.
