procedure TForm1.Button1Click(Sender: TObject);
var
mu,sigma:Extended;
i,n:integer;
x:double;
begin
randomize;
mu:=strtoint(edit1.text);
sigma:=strtoint(edit2.Text);
n:=strtoint(edit3.text);
for i:=0 to n-1 do
begin
x:=randg(mu,sigma);
memo1.lines.add(formatfloat('0.###',x));
end;
end;
end.
integer etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
integer etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
6 Haziran 2014 Cuma
3 Haziran 2014 Salı
Stringgrid,button example. Colcount,Row Count
procedure TForm1.Button1Click(Sender: TObject);
var
r,c,j,i:integer;
begin
r:=strtoint(edit1.text);
c:=strtoint(edit2.text);
StringGrid1.ColCount:=c+1;
StringGrid1.RowCount:=r+1;
for i:=1 to c do
begin
for j:=1 to r do
begin
if (i+j)>r+2 StringGrid1.Cells[i,j]:=inttostr((i+j)-1);
end;
end;
end;
end.
var
r,c,j,i:integer;
begin
r:=strtoint(edit1.text);
c:=strtoint(edit2.text);
StringGrid1.ColCount:=c+1;
StringGrid1.RowCount:=r+1;
for i:=1 to c do
begin
for j:=1 to r do
begin
if (i+j)>r+2
end;
end;
end;
end.
Etiketler:
button,
button1,
delphi,
edit1,
else if,
formatfloat,
if,
integer,
maxvalue,
mean,
minvalue,
progressbar,
random,
randomize,
randomrange,
setlength,
stringgrid,
zar
28 Mayıs 2014 Çarşamba
list of integers,square of integers,square root of integers,stringgrid,progressbar example
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,j,k:integer;
begin
a:=strtoint(edit1.text);
b:=strtoint(edit2.text);
StringGrid1.RowCount:=(b-a+1)+1;
for j:=1 to stringgrid1.RowCount-1 do
StringGrid1.Cells[0,j]:=inttostr(j);
j:=0;
ProgressBar1.Max:=b-a+1;
if RadioButton1.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=inttostr(k);
ProgressBar1.Position:=j;
end;
end
else if RadioButton2.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=inttostr(sqr(k));
ProgressBar1.Position:=j;
end;
end
else if RadioButton3.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=floattostr(sqrt(k));
ProgressBar1.Position:=j;
end;
end;
end;
end.
var
a,b,j,k:integer;
begin
a:=strtoint(edit1.text);
b:=strtoint(edit2.text);
StringGrid1.RowCount:=(b-a+1)+1;
for j:=1 to stringgrid1.RowCount-1 do
StringGrid1.Cells[0,j]:=inttostr(j);
j:=0;
ProgressBar1.Max:=b-a+1;
if RadioButton1.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=inttostr(k);
ProgressBar1.Position:=j;
end;
end
else if RadioButton2.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=inttostr(sqr(k));
ProgressBar1.Position:=j;
end;
end
else if RadioButton3.Checked then
begin
for k:=a to b do
begin
inc(j);
StringGrid1.Cells[1,j]:=floattostr(sqrt(k));
ProgressBar1.Position:=j;
end;
end;
end;
end.
Etiketler:
button,
delphi,
edit1,
else if,
if,
integer,
progressbar,
stringgrid
Kaydol:
Kayıtlar (Atom)