Pengenalan Borland Delphi 7

PENGENALAN BORLAND DELPHI

A. Mengaktifkan Delphi

Start => All Programs => Pilih Borland Delphi 7 => Pilih Delphi 7

Akan tampil Jendela Utama Delphi seperti dibawah ini :

 
  clip_image002

B. clip_image004Komponen Pallete

clip_image006

C. Merancang Form

LATIHAN 1

1. clip_image008clip_image010Desain Form seperti di bawah ini

è

2. Ubah Propertiesnya pada Object Inspector

Object

Name

Caption

Label1

Label1

PROGRAM PERKENALAN

Label2

Label2

Nama :

Label3

Label3

Alamat :

Edit1

Enama

Text : (Hapus aja)

Edit2

Ealamat

Text : (Hapus aja)

Button1

Bkenal

&Kenal

Button2

Bclose

&Close

3.

procedure TForm1.BcloseClick(Sender: TObject);

begin

close

end;

end.

Isikan Listing berikut ini

procedure TForm1.BkenalClick(Sender: TObject);

begin

enama.Text:=’Stephanie’;

ealamat.Text:=’Bekasi’;

end;

LATIHAN 2


Object

Name

Caption

Label1

Label1

Program Pengenalan Dasar Operator dalam Delphi

Label2

Label2

Nilai 1

Label3

Label3

Nilai 2

Label4

Label4

HasiL

Edit1

Enil1

 

Edit2

Enil2

 

Edit3

Enil3

 

Button1

bkali

x

Button2

bbagi

/

Button3

btambah

+

Button4

bkurang

Button5

bdiv

div

Button6

bmod

mod

Button7

bbersih

&Bersih

Button8

bkeluar

&Keluar

clip_image012Penggunaan operator aritmatika pada Delphi

Listing Program :

1. procedure TForm2.bbersihClick(Sender: TObject);

begin

enil1.Text:=”;

enil2.Text:=”;

enil3.Text:=”;

end;

2. procedure TForm2.bkaliClick(Sender: TObject);

var

a,b,c:real;

begin

a:=strtofloat(enil1.Text);

b:=strtofloat(enil2.Text);

c:=a*b;

enil3.Text:=floattostr(c);

end;

3. procedure TForm2.bbagiClick(Sender: TObject);

var

a,b,c:real;

begin

a:=strtofloat(enil1.Text);

b:=strtofloat(enil2.Text);

c:=a/b;

enil3.Text:=floattostr(c);

end;

4. procedure TForm2.btambahClick(Sender: TObject);

var

a,b,c:integer;

begin

a:=strtoint(enil1.Text);

b:=strtoint(enil2.Text);

c:= a+b;

enil3.Text:=inttostr(c);

end;

5. procedure TForm2.bkurangClick(Sender: TObject);

begin

enil3.Text:=floattostr(strtofloat(enil1.Text)-strtofloat(enil2.Text));

end;

6. procedure TForm2.bdivClick(Sender: TObject);

var

a,b,c:integer;

begin

a:=strtoint(enil1.Text);

b:=strtoint(enil2.Text);

c:= a div b;

enil3.Text:=inttostr(c);

end;

7. procedure TForm2.bmodClick(Sender: TObject);

var

a,b,c:integer;

begin

a:=strtoint(enil1.Text);

b:=strtoint(enil2.Text);

c:= a mod b;

enil3.Text:=inttostr(c);

end;

end.

8. procedure TForm2.bkeluarClick(Sender: TObject);

begin

if(application.MessageBox(‘Yakin Anda akan keluar dari program?’,’Informasi’,

MB_YESNO)=IDYES)then

close

end;

end.

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