Membuat aplikasi konversi suhu menggunakan Lazarus


membuat aplikasi lazarus sebenarnya simple dan mudah jika kita mau lebih memahaminya,. dan mengutak-atik,.

Untuk source code seperti dibawah ini :

unit Unit1;

{$mode objfpc}{$H+}

interface

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

type

{ TForm1 }

TForm1 = class(TForm)
BitBtn1: TBitBtn;
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
rea3: TEdit;
kel1: TEdit;
kel2: TEdit;
kel3: TEdit;
cel1: TEdit;
cel2: TEdit;
cel3: TEdit;
fah1: TEdit;
fah2: TEdit;
fah3: TEdit;
rea1: TEdit;
rea2: TEdit;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

{ TForm1 }

{ TForm1 }

procedure TForm1.BitBtn1Click(Sender: TObject);
var
input : real;
begin
if edit1.Text = ” then
begin
edit1.SetFocus;
end
else
begin
try
input:=strtofloat(edit1.Text);
cel1.Text:=floattostr(input * 1.8 + 32);
cel2.Text:=floattostr(input * 0.8);
cel3.Text:=floattostr(input + 273);
rea1.Text:=floattostr(input / 0.8);
rea2.Text:=floattostr(input * 2.25 + 32);
rea3.Text:=floattostr(input / 0.8 + 273);
fah1.Text:=floattostr((input-32)/1.8);
fah2.Text:=floattostr((input-32)/2.25);
fah3.Text:=floattostr((input+459.67)/1.8);
kel1.Text:=floattostr(input-273);
kel2.Text:=floattostr(input* 1.8 – 459.67);
kel3.Text:=floattostr((input-273)/0.8);
except
on EConvertError do
begin
Messagebox(self.Handle,’Jangan memasukan String atau karakter gan😀’,’ooo men,check your fault’,MB_OK + MB_ICONWARNING);
exit;
end;
end;
end

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.Text:=”;
cel1.Text:=”;
cel2.Text:=”;
cel3.Text:=”;
rea1.Text:=”;
rea2.Text:=”;
rea3.Text:=”;
fah1.Text:=”;
fah2.Text:=”;
fah3.Text:=”;
kel1.Text:=”;
kel2.Text:=”;
kel3.Text:=”;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

end.

jika ingin mengunduh aplikasinya bisa di sini [baru]

2 thoughts on “Membuat aplikasi konversi suhu menggunakan Lazarus

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s