PERCOBAAN II
MEMBUAT PASSWORD DAN USERNAME
1. Tujuan. Agar Bintara Mahasiswa mampu membuat tampilan Password
dan Username.
2. Alat
dan Bahan.
a. Laptop;
b. Aplikasi Delphi;
c. Tool Edit;
d. Tool Button
e. Tool Label; dan
f. Tool Shape.
3. Dasar Teori
a. Flowchart Decision.
b.
Tool Edit.
4. Langkah Percobaan.
b. Buat Coding untuk membuat Password dan User
name. Berikut adalah contoh program sederhana:
unit
Unit1;
interface
uses
Winapi.Windows, Winapi.Messages,
System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Label3: TLabel;
Label4: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R
*.dfm}
procedure
TForm1.Button1Click(Sender: TObject);
begin
if
(Edit1.Text='REZKY') AND (Edit2.Text='202308021-E') then
begin
label3.Visible:=true;
label4.Visible:=false;
end;
if
(Edit1.Text<>'REZKY) AND (Edit2.Text='202308021-E') then
begin
label3.Visible:=false;
label4.Visible:=true;
end;
if
(Edit1.Text='REZKY) AND (Edit2.Text<>'202308021-E') then
begin
label3.Visible:=false;
label4.Visible:=true;
end;
if
(Edit1.Text<>'REZKY') AND (Edit2.Text<>'202308021-E') then
begin
label3.Visible:=false;
label4.Visible:=true;
end;
end;
procedure
TForm1.Button2Click(Sender: TObject);
begin
Label3.Visible:=false;
Label4.Visible:=false;
Edit1.Text:='';
Edit2.Text:='';
end;
end.
5. Hasil dan Pembahasan
a.
Hasil.
2)
Tampilan saat
memasukan password/user name yang salah.
3)
Tampilan saat
memasukan password/user name yang benar.
b. Pembahasan.
6. Kesimpulan.