Anyhow, Let's say I have two routines, like these:
Code: Select all
Dim Relay0_Pin As PORTC.Booleans(2)
Dim Relay1_Pin As PORTB.Booleans(1)
'----------------------------------=-=-----------------------------------------
Sub RelayTwoShow() '
'----------------------------------=-=-----------------------------------------
Dim
Pin_Proxy As Boolean
'---------------=-=---------------
CFA632.Clr()
CFA632.TZ_Loc()
CFA632.Write(" . Relay Two . ")
NHH()
Pin_Proxy = Not Relay1_Pin
While BtnVar = BtnNone
If Pin_Proxy <> Relay1_Pin Then
Pin_Proxy = Relay1_Pin
CFA632.BZ_Loc()
Select Pin_Proxy
Case true
CFA632.Write(" [OPEN] ")
Case false
CFA632.Write(" [CLOSED] ")
End Select
EndIf
ReadKeys()
Wend
End Sub
'----------------------------------=-=-----------------------------------------
Sub RelayOneShow() '
'----------------------------------=-=-----------------------------------------
Dim
Pin_Proxy As Boolean
'---------------=-=---------------
CFA632.Clr()
CFA632.TZ_Loc()
CFA632.Write(" . Relay One . ")
NHH()
Pin_Proxy = Not Relay0_Pin
While BtnVar = BtnNone
If Pin_Proxy <> Relay0_Pin Then
Pin_Proxy = Relay0_Pin
CFA632.BZ_Loc()
Select Pin_Proxy
Case true
CFA632.Write(" [OPEN] ")
Case false
CFA632.Write(" [CLOSED] ")
End Select
EndIf
ReadKeys()
Wend
End Sub
So, I've two routines doing exactly the same thing but for different pins.
How would I set it up to be one routine where I pass in the pin reference?
Like:
Sub RelayShow(Pin x) (or something like that)
(...code...)
end sub
Thanx in advance.