Santri Indigo adalah Komunitas Santri Berbudaya Teknologi yang merupakan kerjasama program CSR PT Telkom Indonesia Tbk dengan HU Republika.
Twitter Facebook Feedburner Google +1 youtube
www.santri-indigo.com
Selamat Datang di Portal Santri Indigo Cilacap
Home » , , » Cara Membuat Program Operator Delphi

Cara Membuat Program Operator Delphi

Penulis : ZHANtech | Sabtu, 10 Mei 2014

Santri-Indigo.Com - Lama gak update nih, rasanya kangen banget ingin berbagi sesuatu sama pembaca disini.

Okey, kali ini saya akan berbagi sedikit tentang Cara Membuat Program Operator Delphi, software yang saya pakai disini adalah Delphi7. Dikhususkan untuk yang membutuhkan, atau yang ingin belajar saja.

Bagi pemula silahkan anda baca artikel Pengenalan Delphi 7 terlebih dahulu.

Step by Step :
Buka Delphi7, kemudian buat interface seperti gambar disamping.

Coding Program Operator Delphi :

unit Latihan1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    GroupBox1: TGroupBox;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    GroupBox2: TGroupBox;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    Button10: TButton;
    GroupBox3: TGroupBox;
    Button11: TButton;
    Button12: TButton;
    Button13: TButton;
    Label5: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button10Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Button11Click(Sender: TObject);
    procedure Button12Click(Sender: TObject);
    procedure Button13Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin
edit3.text:=floattostr(strtoint(edit1.text)+strtoint(edit2.text));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit3.text:=floattostr(strtoint(edit1.Text)-strtoint(edit2.Text));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
edit3.text:=floattostr(strtoint(edit1.Text)/strtoint(edit2.Text));
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
edit3.text:=floattostr(strtoint(edit1.Text)*strtoint(edit2.Text));
end;

procedure TForm1.Button10Click(Sender: TObject);
begin
edit1.Text:='0';
edit2.Text:='0';
edit3.Text:='0';
edit1.SetFocus;
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
if(application.MessageBox('Ingin Keluar','Pesan',MB_YESNO)=IDYES) then
close;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
edit3.Text:=booltostr(strtoint(edit1.Text)>strtoint(edit2.Text));
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
edit3.Text:=booltostr(strtoint(edit1.Text)<strtoint(edit2.Text));
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
edit3.Text:=booltostr(strtoint(edit1.Text)=strtoint(edit2.Text));
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
edit3.Text:=booltostr(strtoint(edit1.Text)<>strtoint(edit2.Text));
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
edit1.Text:='0';
edit2.Text:='0';
edit3.Text:='0';
edit1.SetFocus;
end;

procedure TForm1.Button11Click(Sender: TObject);
begin
edit3.Text:=booltostr((strtoint(edit1.Text)>strtoint(edit2.Text))AND(strtoint(edit1.Text)>5));
end;

procedure TForm1.Button12Click(Sender: TObject);
begin
edit3.Text:=booltostr((strtoint(edit1.Text)>strtoint(edit2.Text))OR(strtoint(edit1.Text)>5));
end;

procedure TForm1.Button13Click(Sender: TObject);
begin
edit3.Text:=booltostr((strtoint(edit1.Text)>strtoint(edit2.Text))XOR(strtoint(edit1.Text)>5));
end;

end.

Selamat mencoba, dan apabila belum berhasil bisa di diskusikan pada kolom komentar.

#Helpdesk #Santri-Indigo.Com


Share this article with your friends

1 komentar:

Unknown 18 Agustus 2015 pukul 20.14

jaman semesteer 3

Posting Komentar

Jangan berkunjung tanpa meninggalkan jejak.
- No Spam - No Phising - No Live Link
Salam Blogger Indonesia, Silakan Tinggalkan Pesan Agan disini... !!!

Tukar Link



Copy Paste - Copyright by SIC
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.santri-indigo.com/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4X8slxtycBYdn18VtsohXTzJQmwJhkNtRDtbbJv7tnt5dqou5BIn6OIdm1e3Ql3YM9ZSckUHsSXwpPacPxnw067WXUa7S3TWTDVRYOVwdV5Jwi8aLdKMMMZrX3WtykfUBqAwhWBc3DtA/s150/SI.png" /></a></div>

Bagi yang sudah pasang silahkan tinggalkan komentar