You are on page 1of 15

LAPORAN PRAKTEK PEMROGRAMAN VISUAL

“ LIFT “

ARIF MUTTAQIN

09520244031

F 3.2

FAKULTAS TEKNIK

UNIVERSITAS NEGERI YOGYAKARTA

TAHUN 2010
Script dari program :
Dim lift As Integer
Dim pintu As Integer
Dim pintu1 As Integer
Dim A, B, C, D, E, F, G, H, I, P As Integer

Private Sub Command1_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Timer1.Enabled = True
End If

A=0
If Command1.Caption = "A" Then
Command1.Caption = "^"
A=1
ElseIf Command1.Caption = "^" Then
Command1.Caption = "A"
A=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command2_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Timer1.Enabled = True
End If

B=0
If Command2.Caption = "A" Then
Command2.Caption = "^"
B=1
ElseIf Command2.Caption = "^" Then
Command2.Caption = "A"
B=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command3_Click()

If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

C=0
If Command3.Caption = "A" Then
Command3.Caption = "^"
C=1
ElseIf Command3.Caption = "^" Then
Command3.Caption = "A"
C=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command4_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

D=0
If Command4.Caption = "A" Then
Command4.Caption = "^"
D=1
ElseIf Command4.Caption = "^" Then
Command4.Caption = "A"
D=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command5_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

E=0
If Command5.Caption = "V" Then
Command5.Caption = "v"
E=1
ElseIf Command5.Caption = "v" Then
Command5.Caption = "V"
E=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command6_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

F=0
If Command6.Caption = "V" Then
Command6.Caption = "v"
F=1
ElseIf Command6.Caption = "v" Then
Command6.Caption = "V"
F=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command7_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

G=0
If Command7.Caption = "V" Then
Command7.Caption = "v"
G=1
ElseIf Command7.Caption = "v" Then
Command7.Caption = "V"
G=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

End Sub

Private Sub Command8_Click()


If Label1.Caption = "Pintu Lift Tertutup (Berhenti)" Then
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If

H=0
If Command8.Caption = "V" Then
Command8.Caption = "v"
H=1
ElseIf Command8.Caption = "v" Then
Command8.Caption = "V"
H=0
Timer1.Enabled = True
End If

If Label1.Caption = "Pintu Lift Terbuka" And Label1.ForeColor = &HFF00& Then


Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Timer1.Enabled = True
End If
End Sub

Private Sub Command13_Click()

If Label1.Caption = "Pintu Lift Ditutup" And Shape10.FillColor = &HFF00& Then


Shape15.FillColor = &H80FF&
Label1.ForeColor = &HFF&
E=1
Timer1.Enabled = True
End If

If Label2.Caption = "Silahkan Masuk><Keluar" Then


Label2.Caption = "Tutup Dulu Pintunya..!!!"
End If

End Sub
Private Sub Command12_Click()

If Label1.Caption = "Pintu Lift Ditutup" And Shape9.FillColor = &HFF00& Then


Shape14.FillColor = &H80FF&
Label1.ForeColor = &HFF&
D=1
F=1
Timer1.Enabled = True
End If

If Label2.Caption = "Silahkan Masuk><Keluar" Then


Label2.Caption = "Tutup Dulu Pintunya..!!!"
End If

End Sub
Private Sub Command11_Click()

If Label1.Caption = "Pintu Lift Ditutup" And Shape8.FillColor = &HFF00& Then


Shape13.FillColor = &H80FF&
Label1.ForeColor = &HFF&
C=1
G=1
Timer1.Enabled = True
End If

If Label2.Caption = "Silahkan Masuk><Keluar" Then


Label2.Caption = "Tutup Dulu Pintunya..!!!"
End If
End Sub
Private Sub Command10_Click()

If Label1.Caption = "Pintu Lift Ditutup" And Shape7.FillColor = &HFF00& Then


Shape12.FillColor = &H80FF&
Label1.ForeColor = &HFF&
B=1
H=1
Timer1.Enabled = True
End If

If Label2.Caption = "Silahkan Masuk><Keluar" Then


Label2.Caption = "Tutup Dulu Pintunya..!!!"
End If

End Sub
Private Sub Command9_Click()

If Label1.Caption = "Pintu Lift Ditutup" And Shape6.FillColor = &HFF00& Then


Shape11.FillColor = &H80FF&
Label1.ForeColor = &HFF&
A=1
Timer1.Enabled = True
End If

If Label2.Caption = "Silahkan Masuk><Keluar" Then


Label2.Caption = "Tutup Dulu Pintunya..!!!"
End If

End Sub

Private Sub Command14_Click()

If Label1.Caption = "Pintu Lift Terbuka" Then


Label1.Caption = "Pintu Lift Ditutup"
Label1.ForeColor = &HFF&
Label2.Caption = "Pencet Tujuan Lantai -> Untuk Jalan"
End If
End Sub
Private Sub Timer1_Timer()

If lift = 0 Then
If A = 1 Then
Shape1.FillColor = &HFF&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 1
Timer1.Enabled = False
Shape6.FillColor = &HFFFF&
Shape7.FillColor = &HFF00&
Shape8.FillColor = &HFF00&
Shape9.FillColor = &HFF00&
Shape10.FillColor = &HFF00&

H=0
Shape12.FillColor = &H0&
Command1.Caption = "A"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &HFF&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 1
Shape6.FillColor = &HFFFF&
Shape7.FillColor = &H0&
Shape8.FillColor = &H0&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

Shape12.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 1 Then


If B = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &HFF&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 2
Timer1.Enabled = False
Shape6.FillColor = &H0&
Shape7.FillColor = &HFFFF&
Shape8.FillColor = &HFF00&
Shape9.FillColor = &HFF00&
Shape10.FillColor = &HFF00&

B=0
A=0
H=0
Shape11.FillColor = &H0&
Command2.Caption = "A"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &HFF&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 2
Shape6.FillColor = &H0&
Shape7.FillColor = &HFFFF&
Shape8.FillColor = &H0&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

A=0
Shape11.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 2 Then


If C = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &HFF&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 3
Timer1.Enabled = False
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &HFFFF&
Shape9.FillColor = &HFF00&
Shape10.FillColor = &HFF00&
Command3.Caption = "A"
B=0
G=0
Shape12.FillColor = &H0&
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &HFF&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 3
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &HFFFF&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

A=0
B=0
Shape12.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 3 Then


If D = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &HFF&
Shape5.FillColor = &H0&
lift = 4
Timer1.Enabled = False
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &H0&
Shape9.FillColor = &HFFFF&
Shape10.FillColor = &HFF00&

F=0
Shape13.FillColor = &H0&
Command4.Caption = "A"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &HFF&
Shape5.FillColor = &H0&
lift = 4
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &H0&
Shape9.FillColor = &HFFFF&
Shape10.FillColor = &H0&

C=0
Shape13.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 4 Then


If E = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &HFF&
lift = 5
Timer1.Enabled = False
Shape6.FillColor = &HFF00&
Shape7.FillColor = &HFF00&
Shape8.FillColor = &HFF00&
Shape9.FillColor = &HFF00&
Shape10.FillColor = &HFFFF&

D=0
Shape14.FillColor = &H0&
Command5.Caption = "V"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &HFF&
lift = 5
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &H0&
Shape9.FillColor = &H0&
Shape10.FillColor = &HFFFF&
C=0
D=0
Shape14.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 5 Then


If F = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &HFF&
Shape5.FillColor = &H0&
lift = 6
Timer1.Enabled = False
Timer2.Enabled = True
Shape6.FillColor = &HFF00&
Shape7.FillColor = &HFF00&
Shape8.FillColor = &HFF00&
Shape9.FillColor = &HFFFF&
Shape10.FillColor = &H0&

E=0
D=0
Shape15.FillColor = &H0&
Command6.Caption = "V"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Shape4.FillColor = &HFF&
Shape5.FillColor = &H0&
lift = 6
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &H0&
Shape9.FillColor = &HFFFF&
Shape10.FillColor = &H0&

E=0
Shape15.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 6 Then


If G = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &HFF&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 7
Timer1.Enabled = False
Shape6.FillColor = &HFF00&
Shape7.FillColor = &HFF00&
Shape8.FillColor = &HFFFF&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

F=0
C=0
Shape14.FillColor = &H0&
Command7.Caption = "V"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &HFF&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 7
Shape6.FillColor = &H0&
Shape7.FillColor = &H0&
Shape8.FillColor = &HFFFF&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

F=0
Shape14.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If

ElseIf lift = 7 Then


If H = 1 Then
Shape1.FillColor = &H0&
Shape2.FillColor = &HFF&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 0
Timer1.Enabled = False
Shape6.FillColor = &HFF00&
Shape7.FillColor = &HFFFF&
Shape8.FillColor = &H0&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

G=0
B=0
Shape13.FillColor = &H0&
Command8.Caption = "V"
Label1.Caption = "Pintu Lift Terbuka"
Label1.ForeColor = &HFF00&
Label2.Caption = "Silahkan Masuk><Keluar"
Else
Shape1.FillColor = &H0&
Shape2.FillColor = &HFF&
Shape3.FillColor = &H0&
Shape4.FillColor = &H0&
Shape5.FillColor = &H0&
lift = 0
Shape6.FillColor = &H0&
Shape7.FillColor = &HFFFF&
Shape8.FillColor = &H0&
Shape9.FillColor = &H0&
Shape10.FillColor = &H0&

G=0
Shape13.FillColor = &H0&
Label1.Caption = "Pintu Lift Tertutup (Jalan)"
Label1.ForeColor = &HFF&
Label2.Caption = ""
End If
End If

End Sub
Print screen :

Tombol untuk menutup pintu,


jika pintu belum ditutup lift tidak
akan bergerak

Tombol yang digunakan ketika


Tombol yang digunakan
user berada di luar lift
ketika user berada di dalam
lift

You might also like