listing Program
procedure TForm1.FormCreate(Sender: TObject);
begin
cpener.Items.Add('GA733');
cpener.Items.Add('MP373');
cpener.Items.Add('BT202');
cpener.Items.Add('LI909');
ejtiket.Text :='0';
ehrg1.Text :='0';
ehrg2.Text :='0';
ejml1.Text :='0';
ejml2.Text :='0';
etharga1.Text :='0';
etharga2.Text :='0';
etotbay.Text :='0';
ebayar.Text :='0';
ekembali.Text :='0';
//dateseparator:='-';u pemisah antara tgl.bln&thn
ShortDateFormat :='dd-mmmm-yyyy';
etgl.Text :=datetostr(date);
end;
procedure TForm1.cpenerClick(Sender: TObject);
begin
if cpener.Text ='GA733' then
enmpswt.Text :='GARUDA AIR'
else
if cpener.Text ='MP373' then
enmpswt.Text :='MERPATI AIR'
else
if cpener.Text ='BT202' then
enmpswt.Text :='BATAVIA AIR'
else
enmpswt.Text :='LION AIR'
end;
procedure TForm1.cb1Click(Sender: TObject);
begin
if cb1.Checked =true then
begin
if cpener.Text ='GA733' then
ehrg1.Text :='560000'
else
if cpener.Text ='MP373' then
ehrg1.Text :='450000'
else
if cpener.Text ='BT202' then
ehrg1.Text :='350000'
else
ehrg1.Text :='4500000'
end
else
begin
cb1.Checked :=false;
ehrg1.Text :='0';
end ;
ejml1.SetFocus ;
end;
procedure TForm1.cb2Click(Sender: TObject);
var a,b:real;
begin
if cb2.Checked =true then
begin
a:=strtofloat(ehrg1.Text );
b:=(3/100)*a;
ehrg2.Text :=floattostr(b);
end
else
begin
cb2.Checked :=false;
ehrg2.Text :='0';
end;
ejml2.SetFocus ;
end;
procedure TForm1.bhitungClick(Sender: TObject);
begin
etharga1.Text :=floattostr(strtofloat(ehrg1.Text )*strtofloat(ejml1.Text ));
etharga2.Text :=floattostr(strtofloat(ehrg2.Text )*strtofloat(ejml2.Text ));
ejtiket.Text :=floattostr(strtofloat(ejml2.Text )+strtofloat(ejml1.Text ));
etotbay.Text :=floattostr(strtofloat(etharga2.Text )+strtofloat(etharga1.Text ));
ebayar.SetFocus ;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
ehrg1.Enabled :=false;
etharga1.Enabled :=false;
ehrg2.Enabled :=false;
etharga2.Enabled :=false;
ejtiket.Enabled :=false;
etotbay.Enabled :=false;
ekembali.Enabled :=false;
enmpswt.Enabled :=false;
end;
procedure TForm1.bbersihClick(Sender: TObject);
begin
enmpembeli.Text :='';
cpener.Text :='';
enmpswt.Text :='';
cb1.Checked :=false;
cb2.Checked :=false;
ejtiket.Text :='0';
ehrg1.Text :='0';
ehrg2.Text :='0';
ejml1.Text :='0';
ejml2.Text :='0';
etharga1.Text :='0';
etharga2.Text :='0';
etotbay.Text :='0';
ebayar.Text :='0';
ekembali.Text :='0';
enmpembeli.SetFocus ;
end;
procedure TForm1.bcloseClick(Sender: TObject);
begin
if(Application.MessageBox('anda yakin akan keluar','informasi',mb_yesno+mb_iconwarning )=idyes)then
close
end;
procedure TForm1.ebayarChange(Sender: TObject);
begin
ekembali.Text :=floattostr(strtofloat(ebayar.Text )-strtofloat(etotbay.Text ));
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ejam.Text :=timetostr(time);
end;
end.
Tidak ada komentar:
Posting Komentar