Search for Knowledge
“A mistake is a signal that it is time to learn something new, something you didn’t know before.”

Translator Sederhana

Translator Sederhana

Pertama-tama, buat terlebih dahulu menggunakan

Lalu pada lalu pada object inspector, lakukan sedikit perubahan :

Label 1 ubah dengan (caption) Translator Sederhana
Edit1 ubah dengan (text) ‘ ‘/Kosonkan
Button1 ubah dengan (caption) translate
Button2 ubah dengan (caption) hapus
Button3 ubah dengan (caption) keluar
Label 2 ubah dengan (caption) ‘ ‘/Kosongkan

Yang saya beri tanda () berarti berada pada Object Inspector

Lalu Lakukan Penambahan Coding Pada Button1 (Translate)

~ Deklarasi ~

procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.text = ‘RAM’ THEN
begin
label2.Caption := ‘Random Access Memory’;
end
else
if edit1.Text = ‘ENIAC’ then
begin
label2.Caption := ‘Electronic Numerical Integrator And Calculator’;
end
else
if edit1.Text = ‘ROM’ then
begin
label2.Caption := ‘Read Only Memory’;
end
else
if edit1.Text = ‘EDSAC’ then
begin
label2.Caption := ‘Electronic Delayed Storage Automatic Computer’;
end
else
if edit1.Text = ‘UNIVAC’ then
begin
label2.caption := ‘Universal Automatic Computer’;
end
else
if edit1.Text = ‘EDSAC’ then
begin
label2.Caption := ‘Electronic Discrete Variabel Automatic Computer’;
end
else
if edit1.Text = ‘BIOS’ then
begin
label2.Caption := ‘Basic Input Output System’;
end
else
if edit1.Text = ‘IC’ then
begin
label2.caption := ‘Integrated Circuit’;
end
else
if edit1.Text = ‘LSI’ then
begin
label2.Caption := ‘Large Scale Integration’;
end
else
if edit1.Text = ‘VLSI’ then
begin
label2.caption := ‘Very Large Scale Integration’;
end
else
if edit1.Text = ‘CAT’ then
begin
label2.caption := ‘Computer Axial Tomograph’;
end
else
if edit1.Text = ‘RLE’then
begin
label2.Caption := ‘Run Lenght Encode’;
end
else
if edit1.Text = ‘CMD’ then
begin
label2.caption := ‘Command Prompt’;
end
else
if edit1.Text = ‘ADSL’ then
begin
label2.Caption := ‘Asymmetric Digital Subscriber Line’;
end
else
if edit1.Text = ‘ALU’ then
begin
label2.Caption := ‘Arithmetic Logic Unit’;
end
else
if edit1.Text = ‘ATX’ then
begin
label2.Caption := ‘Advanced Technology Extended’;
end
else
if edit1.Text = ‘BNC’ then
begin
label2.Caption := ‘Barrel Nut Connector’;
end
else
if edit1.Text = ‘ASCII’ then
begin
label2.Caption := ‘American Standard Code for Information Interchange’;
end
else
if edit1.Text = ‘AMD’ then
begin
label2.Caption := ‘Advanced Micro Devices’;
end
else
if edit1.Text = ‘CPU’ then
begin
label2.Caption := ‘Central Processing Unit’;
end
end;

Serta Lakukan juga penambahan coding pada Button2 (hapus)

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text := ”;
label2.Caption := ”;
end;

Tambahkan juga untuk yang Button3 (keluar)

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

end.

Maka ketika di Run akan muncul seperti ini, Sesuai dengan perintah-perintah syntax dari coding.