Wy22’s Weblog

Just another WordPress.com weblog

Program Parkir (Delphi)

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Buttons, ExtCtrls;

type

TForm1 = class(TForm)

Panel1: TPanel;

Label1: TLabel;

nopol: TEdit;

Label2: TLabel;

Bayar: TEdit;

Label3: TLabel;

jummotor: TEdit;

Label4: TLabel;

BitBtn1: TBitBtn;

jumbm: TEdit;

procedure FormCreate(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

procedure nopolKeyPress(Sender: TObject; var Key: Char);

procedure BayarKeyPress(Sender: TObject; var Key: Char);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

begin

nopol.Text:=’BE’;

Bayar.Text:=”;

jummotor.Text:=’0′;

jumbm.Text:=’0′;

end;

procedure TForm1.BitBtn1Click(Sender: TObject);

begin

Application.Terminate;

end;

procedure TForm1.nopolKeyPress(Sender: TObject; var Key: Char);

begin

if key=#13then

Bayar.SetFocus;

end;

procedure TForm1.BayarKeyPress(Sender: TObject; var Key: Char);

var

bay:string;

jm,jbm : integer;

begin

if key=#13 then

begin

bay:= bayar.Text;

jm:=strtoint(jummotor.Text);

jbm:=StrToInt(jumbm.Text);

if bay=’1′ then

begin

jm:=jm+1;

jbm:=jbm+500;

jummotor.Text:=IntToStr(jm);

jumbm.Text:=IntToStr(jbm);

 

end

else

Application.MessageBox(‘Selain 1 logikanya Tidak Menghitung !!!’,’Peringatan’,MB_OK or MB_ICONWARNING);

Bayar.SetFocus;

Bayar.Text:=”;

end;

end;

end.

 

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: