INFICON SQM-160 Thin Film Deposition Monitor User Manual

Page 73

Advertising
background image

5 - 13

IP

N 07

4-

51

1-

P1

C

SQM-160 Operating Manual

End Sub

Public Function LoByte(ByVal intNumber As Integer) As Byte

' Comments : Returns the low byte of the passed integer
' Parameters: intNumber - integer value for which to return the low
byte
' Returns : byte
' 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

Advertising