第6題
Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal X As Integer, ByVal Y As Integer)
Dim a, b(99), c As Integer
Private Sub Command1_Click(Index As Integer)
a = Index
c = 0
End Sub
Private Sub Form_Load()
a = 99
b(0) = &H1
b(1) = &H3
b(2) = &H7
b(3) = &HF
b(4) = &H1F
b(5) = &H3F
b(6) = &H7F
End Sub
Private Sub Timer1_Timer()
If c > 14 Then c = 14
Text1.Text = "Current Time:" & Time$
Out &H37A, 0
Out &H378, 4
Out &H378, 0
If a = 0 Then
Out &H37A, 8
Out &H378, b(c)
End If
If a = 1 Then
Out &H378, 2 ^ c
Out &H37A, 4
Out &H37A, 0
End If
If a = 2 Then End
c = c + 1
End Sub
隨機製作
Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal x As Integer, ByVal y As Integer)
Dim a, b(99), c As Integer
Private Sub Command1_Click(Index As Integer)
a = Index
c = 0
End Sub
Private Sub Form_Load()
a = 99
b(0) = &H60
b(1) = &H30
b(2) = &H18
b(3) = &HC
b(4) = &H6
b(5) = &H3
End Sub
Private Sub Timer1_Timer()
If c > 14 Then c = 14
Text1.Text = " current time:" & Time$
Out &H378, 0
Out &H37A, 4
Out &H37A, 0
If a = 0 Then
Out &H37A, 8
Out &H378, b(c)
End If
If a = 1 Then
Out &H378, 2 ^ c
Out &H37A, 4
Out &H37A, 0
End If
If a = 2 Then End
c = c + 1
End Sub |