0% found this document useful (0 votes)
19 views3 pages

Aplikasi Dengan Menggunakan Array.2

This document describes an application that uses arrays in Delphi. It defines two arrays, one for country names and one for currencies. When a country is selected from a dropdown, the label displays the corresponding country and currency. The form creation procedure populates the dropdown with countries from the country array. When an item is selected, it searches the country array to get the index, then displays the matching currency from the currency array in the label.

Uploaded by

Arfan Fathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Aplikasi Dengan Menggunakan Array.2

This document describes an application that uses arrays in Delphi. It defines two arrays, one for country names and one for currencies. When a country is selected from a dropdown, the label displays the corresponding country and currency. The form creation procedure populates the dropdown with countries from the country array. When an item is selected, it searches the country array to get the index, then displays the matching currency from the currency array in the label.

Uploaded by

Arfan Fathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

APLIKASI DENGAN MENGGUNAKAN ARRAY.

Tampilan sebelum di RUN

KODING APLIKASI :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Click(Sender: TObject);
private
{ Private declarations }
negara : array [1..12] of string;
matauang : array [1..12] of string;
public
{ Public declarations }
end;
var
Form1: TForm1;

implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var indeks : integer;
begin
Negara[1] := 'Indonesia';
Negara[2] := 'singapore';
Negara[3] := 'malaysia';
Negara[4] := 'thailand';
Negara[5] := 'netherland';
Negara[6] := 'england';
Negara[7] := 'italia';
Negara[8] := 'saudi arabia';
Negara[9] := 'australia';
Negara[10] := 'japan';
Negara[11] := 'united state';
Negara[12] := 'india';
matauang[1] := 'rupiah';
matauang[2] := 'dollar singapore';
matauang[3] := 'ringgit';
matauang[4] := 'peso';
matauang[5] := 'gulden';
matauang[6] := 'poundsterling';
matauang[7] := 'lira';
matauang[8] := 'real';
matauang[9] := 'doolar australia';
matauang[10] := 'yen';
matauang[11] := 'dollar';
matauang[12] := 'rupee';
for indeks := 1 to 12 do
ComboBox1.Items.Add(negara[indeks])
end;
procedure TForm1.ComboBox1Click(Sender: TObject);
var NamaNegara : string;
NamaMataUang : string ;
indeks : integer ;
begin
NamaNegara:=ComboBox1.Text;
for indeks := 1 to 12 do
if NamaNegara = Negara[indeks] then break;

NamaMataUang := matauang[indeks];
Label1.Caption :='negara :'+''+namanegara+
chr(13)+chr(10)+
'matauang :'+namamatauang;
end;
end.

Tampilan setelah di RUN

You might also like