Public Function Shift(ByVal lValue As Long, ByVal lNumberOfBitsToShift As Long, ByVal lDirectionToShift As dcShiftDirection) As Long
Const ksCallname As String = "Shift"
On Error GoTo Procedure_Error
Dim LShift As Long
If lDirectionToShift Then 'shift left
LShift = lValue * (2 ^ lNumberOfBitsToShift)
Else 'shift right
LShift = lValue \ (2 ^ lNumberOfBitsToShift)
End If
Procedure_Exit:
Shift = LShift
Exit Function
Procedure_Error:
Err.Raise Err.Number, ksCallname, Err.Description, Err.HelpFile, Err.HelpContext
Resume Procedure_Exit
End Function