









BitSet – Set a bit in a number
‘ Set a bit in a value” NOTE: requires Power2()Function BitSet(ByVal value As Long, ByVal bit As Long) As Long ‘ simply OR with the bit mask ‘ Range checking
‘ Set a bit in a value” NOTE: requires Power2()Function BitSet(ByVal value As Long, ByVal bit As Long) As Long ‘ simply OR with the bit mask ‘ Range checking
‘ Raise 2 to a power’ the exponent must be in the range [0,31]Function Power2(ByVal exponent As Long) As Long Static res(0 To 31) As Long Dim i As Long
‘ Shift to the right of the specified number of times” NOTE: requires Power2()Function ShiftRight(ByVal value As Long, ByVal times As Long) As Long ‘ we need to create a
‘ Rotate a Long to the right the specified number of times” NOTE: requires Power2()Function RotateRight(ByVal value As Long, ByVal times As Long) As Long Dim i As Long, signBits
‘ Rotate a Long to the left the specified number of times” NOTE: requires Power2()Function RotateLeft(ByVal value As Long, ByVal times As Long) As Long Dim i As Long, signBits
‘ Toggle a bit in a value” NOTE: requires Power2()Function BitToggle(ByVal value As Long, ByVal bit As Long) As Long ‘ simply XOR with the negation of the bit mask
When you write a screen saver in C and SDK you can use a static library (SCRNSAVE.LIB) that allows you to create custom dialogs to change and request the password.
‘ Rotate an Integer to the right the specified number of times” NOTE: requires Power2()Function RotateRightI(ByVal value As Integer, ByVal times As Long) As Integer Dim i As Long, signBits
‘ Rotate an Integer to the left the specified number of times” NOTE: requires Power2()Function RotateLeftI(ByVal value As Integer, ByVal times As Long) As Integer Dim i As Long, signBits