BitToggle – Invert a bit in a value
‘ 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
‘ 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
‘ 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
‘ 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
‘ 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
‘ 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
‘ Test the value of a bit” NOTE: requires Power2()Function BitTest(ByVal value As Long, ByVal bit As Long) As Boolean ‘ simply AND with the bit mask ‘ Range checking
It is sometimes useful to be able to obtain a complete list of the components in a container hierarchy. A getComponents() method is provided in the java.awt.Container class, but it
Pausing SQL Server prevents new users from logging in and gives you time to send a message to current users asking them to complete their work and log out before
Pointer-based operations are less frequently needed than they might seem. For instance, examine this class declaration: class PointerMisuse{private: CDC * m_pDeviceContext;public: PointerMisuse(); ~PointerMisuse();};PointerMisuse::PointerMisuse(){ m_pDeviceContext = new CDC;}PointerMisuse::~PointerMisuse(){ delete m_pDeviceContext;} Even