ARRAY 2 DIMENSI
By pelita nuramini - Maret 23, 2019
ARRAY 2 DIMENSI
Namaarray
= array [index baris, index kolom] of tipe data
Tarraynama
= array [1..4, 1..2] of string
Procedure
TformBab2.fromcreate (sender : tobject);
Type
Tarraynama = array [1..4, 1..2] of string;
Var
Jazzsinger : Tarraynama;
Teks :
string;
I :
integer;
Begin
//pemberian nilai ke array
Jazzsinger[1,1] := ‘Indonesia’;
Jazzsinger[1,2] := ‘Jakarta’;
Jazzsinger[2,1] := ‘Australia’;
Jazzsinger[2,1] := ‘Camberra’;
Jazzsinger[3,1] := ‘Malaysia’;
Jazzsinger[3,2] := ‘Kuala Lumpur’;
Jazzsinger[4,1] := ‘Thailad’;
Jazzsinger[4,2] := ‘Bangkok’;
//tampilkan
isi array
Teks :=
” ; //string kosong
For I
:= 1 to 4 do
Teks :=
teks + infonegara[I,1] + ‘ – ‘ +
Infonegara[I,2] + #13#10;
Labelinfo.caption:=teks;
End;
0 komentar