Sabtu, 10 Maret 2012

Program Penggunaan Option Explisit pada visual basic















Option Explisit digunakan untuk memerintahkan supaya seluruh variabel didefinisikan.  Berikut kode program disamping :

Option Explicit
Dim test1, test2, test3 As Integer

Private Sub Command1_Click()
Dim test1 As String
test1 = "Nusantara"
Label1.Caption = test1
Label2.Caption = test2
Label3.Caption = test3
End Sub


Private Sub Command2_Click()
test2 = 10
Label1.Caption = test1
Label2.Caption = test2
Label3.Caption = test3
End Sub

Private Sub Command3_Click()
Const test3 As Single = 90.55
Label1.Caption = test1
Label2.Caption = test2
Label3.Caption = test3
End Sub
 

0 komentar:

Posting Komentar

 
;