mam program ktory vyzrebuje 20 nahodnych cisel ktore vypise do dvadsiatich Editov.
Prvy problem je ze chcem aby ich vypisovalo postupne t.j. Vyzrebuje cislo do Edit1, pocka sekundu, vyzrebuje cislo do Edit2, pocka atd...
Skusal som pomedzi to podavat Sleep ale vtedy len spocita tie Sleep a po stlaceni tlacidla pocka a potom vylosuje vsetky naraz.
Druhy problem je ze kod mam (vid. dole) a chcem nieco aby som to tam nemusel mat komplet vsetko vypisane od edit1 az po edit20, urcite sa to robi nejako inak ale u mna bolo hlavne ze to fungovalo
Kód: Vybrať všetko
unit keno;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Edit16: TEdit;
Edit17: TEdit;
Edit18: TEdit;
Edit19: TEdit;
Edit20: TEdit;
Label1: TLabel;
MainMenu1: TMainMenu;
About1: TMenuItem;
About2: TMenuItem;
Label2: TLabel;
Label3: TLabel;
Edit21: TEdit;
procedure Button1Click(Sender: TObject);
procedure About2Click(Sender: TObject);
procedure About1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t: integer;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
randomize;
a:= 1 + random(81);
b:= 1 + random(81);
c:= 1 + random(81);
d:= 1 + random(81);
e:= 1 + random(81);
f:= 1 + random(81);
g:= 1 + random(81);
h:= 1 + random(81);
i:= 1 + random(81);
j:= 1 + random(81);
k:= 1 + random(81);
l:= 1 + random(81);
m:= 1 + random(81);
n:= 1 + random(81);
o:= 1 + random(81);
p:= 1 + random(81);
q:= 1 + random(81);
r:= 1 + random(81);
s:= 1 + random(81);
t:= 1 + random(81);
Edit1.Text:= IntToStr(a);
Edit2.Text:= IntToStr(b);
Edit3.Text:= IntToStr(c);
Edit4.Text:= IntToStr(d);
Edit5.Text:= IntToStr(e);
Edit6.Text:= IntToStr(f);
Edit7.Text:= IntToStr(g);
Edit8.Text:= IntToStr(h);
Edit9.Text:= IntToStr(i);
Edit10.Text:= IntToStr(j);
Edit11.Text:= IntToStr(k);
Edit12.Text:= IntToStr(l);
Edit13.Text:= IntToStr(m);
Edit14.Text:= IntToStr(n);
Edit15.Text:= IntToStr(o);
Edit16.Text:= IntToStr(p);
Edit17.Text:= IntToStr(q);
Edit18.Text:= IntToStr(r);
Edit19.Text:= IntToStr(s);
Edit20.Text:= IntToStr(t);
end;
procedure TForm1.About2Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TForm1.About1Click(Sender: TObject);
begin
Form2.Show;
end;
end.