PERTEMUAN KE 3
DAFTAR NAMA PESERTA
- Adapun gambar dari form program aplikasinya seperti di bawah ini :
- Adapun Script (listing program aplikasinya) dapat dilihat di bawah ini :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
lbdata: TListBox;
Button1: TButton;
Edit1: TEdit;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
nama1,nama2:array [1..5] of string;
s:string;
begin
s:=inputbox ('inputdata','masukkan jumlah data : ','0');
for i:=1 to strtoint(s) do
begin
nama1[i]:=inputbox('data ke:'+inttostr(i),'nama awal',' ');
nama2[i]:=inputbox('data ke :'+inttostr(i),'nama belakang',' ');
lbdata.items.add(nama1[i]+ ' ' +nama2[i]);
edit1.Text:=inttostr(lbdata.items.count);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
lbdata.clear;
edit1.Text:=' ';
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
end.
- Adapun gambar dari form running program aplikasinya seperti di bawah ini :
0 komentar:
Posting Komentar