STRUKTUR DATA
By pelita nuramini - Maret 23, 2019
CODING
ARRAY
Array : kumpulan data yang sejenis.
Nama_array
= array [index] of tipe data.
Tarraynama
= array [1..5] of string.
Procedure
TformBab2.fromcreate (sender : tobject);
Type
Tarraynama = array [1..5] of string;
Var
Jazzsinger : Tarraynama;
Teks :
string;
I :
integer;
Begin
//pemberian nilai ke array
Jazzsinger[1] := ‘rien jamain’;
Jazzsinger[2] := ‘minung wardiman’;
Jazzsinger[3] := ‘margie siegers’;
Jazzsinger[4]
:= ‘syaharani’;
Jazzsinger[5] := ‘andien’;
//tampilkan
isi array
Teks :=”;//string
kosong
For I
:= 1 to 5 do
Teks :=
teks + ’jazzsinger [‘ + inttostr
(I) +
‘] : ’ + jazzsinger [I] + #13#10;
Labelinfo.caption:=teks;
End;
0 komentar