Saturday, 21 June 2014
Cara Membuat Program Procedure And Function
PROGRAM PERHITUNGAN
Luas Alas dan Volume Balok
Listing Program di Button Volume:
rocedure TForm1.BVolumeClick(Sender: TObject);
Var LBalok:Integer;begin
EVolume.Text :=VBalok(EPanjang,ELebar,ETinggi,LBalok);
ELuas.Text := IntToStr(LBalok)+' cm2';
end;
procedure TForm1.BResetClick(Sender: TObject);
begin
Reset
end;
procedure TForm1.EPanjangKeyPress(Sender: TObject; var Key: Char);
begin
If Not (Key in ['0'..'9',#8,#13])then Key:=#0;
end;
procedure TForm1.btnkeluarClick(Sender: TObject);
begin
halt;
end;
Listing Program di Button Reset :
procedure TForm1.BResetClick(Sender: TObject);
beginReset
end;
procedure TForm1.EPanjangKeyPress(Sender: TObject; var Key: Char);
begin
If Not (Key in ['0'..'9',#8,#13])then Key:=#0;
end;
procedure TForm1.btnkeluarClick(Sender: TObject);
begin
halt;
end;
Listing Program di Button Keluar:
procedure TForm1.btnkeluarClick(Sender: TObject);
beginhalt;
end;