INFICON SQC-310 Thin Film Deposition Controller User Manual
Page 100

5 - 20
IP
N 07
4-
55
0-
P1
B
SQC-310 Operating Manual
' Source : Total VB SourceBook 6
'
On Error GoTo PROC_ERR
LoByte = intNumber And &HFF&
PROC_EXIT:
Exit Function
PROC_ERR:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
"LoByte"
Resume PROC_EXIT
End Function
Public Function Shri( _
ByVal lngValue As Long, _
ByVal bytPlaces As Byte) _
As Integer
' Comments : Shifts a long Value right the selected number of places
' Parameters: lngValue - integer Value to shift
' bytPlaces - number of places to shift
' Returns : Shifted value
' Source : Total VB SourceBook 6
'
Dim lngDivisor As Long
On Error GoTo PROC_ERR
' if we are shifting 16 or more bits, then the result is always
zero
If bytPlaces >= 16 Then
Shri = 0
Else
lngDivisor = 2 ^ bytPlaces
Shri = Int(IntToLong(lngValue) / lngDivisor)
End If
PROC_EXIT:
Exit Function
PROC_ERR:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
"Shri"
Resume PROC_EXIT
End Function