devxlogo

June 26, 1999

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

RotateLeft – Rotate a Long to the left

‘ 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

RotateRight – Rotate a Long to the right

‘ 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

Build List of Components in Hierarchy

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

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

Minimize the Use of Pointers and Dynamic Memory Allocation

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

Beware of Single Quotes When Working With SQL

When concatenating a SQL statement such as INSERT, you may have trouble if your field value contains an apostrophe (‘) such as in “Commedia Dell’Arte.” SQL thinks the apostrophe is