I have the following code snippet
Code: Select all
Select Case True
Case GetButton(UpButton)
The GetButton function is as follows:
Code: Select all
Public Function GetButton(ByVal ButtonNumber As Byte) As Boolean
Const ButtonPressed As Byte = 0
Select Case ButtonNumber
Case 1
GetButton = (GetPin(Button1Pin) = ButtonPressed)
Case 2
GetButton = (GetPin(Button2Pin) = ButtonPressed)
Case 3
GetButton = (GetPin(Button3Pin) = ButtonPressed)
Case 4
GetButton = (GetPin(Button4Pin) = ButtonPressed)
Case Else
GetButton = False
End Select
End Function
-Tony