Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA
Category: General VBA/VB6 : Data Type and Unit Conversion
Description: Convert among different types of data such as bit operations, units of measure

Module: modBitOps

Routines for bitwise and unsigned data manipulation.

Visual Basic does not provide any native methods for performing bitwise manipulation, nor does it provide unsigned data types. This module remedies those limitations with routines for bit shifting, setting and clearing bits, unsigned assignment operations, and extracting components of variables.

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the modBitOps module
BitClearByte Procedure Clear a bit in a byte variable
BitClearInteger Procedure Clear a bit in a long variable
BitClearLong Procedure Clear a bit in a long variable
BitSetByte Procedure Set a bit in a byte variable
BitSetInteger Procedure Set a bit in an integer variable
BitSetLong Procedure Set a bit in a long variable
BitTestByte Procedure Test a bit to see if it is turned on
BitTestInteger Procedure Test a bit to see if it is turned on
BitTestLong Procedure Test a bit to see if it is turned on
dblToLong Procedure This routine does an unsigned conversion from a double value to a Long value. This function correctly handles doubles greater than 2,147,483,647 and less than or equal to 4,294,967,295.
HiByte Procedure Returns the high byte of the passed integer
HiLong Procedure Returns the high long of the passed double
HiWord Procedure Returns the high integer of the passed long
IntToByte Procedure This routine does an unsigned conversion from an integer value to a byte value. It correctly handles any integer value.
IntToLong Procedure Convert an Integer value to a Long value, treating the integer as unsigned. For example, performing the following assignment lngNumber = -1 assigns -1 to the variable lngNumber. However, This assignment lngNumber = IntToLong(-1) assigns 65,535 to lngNumber.
LoByte Procedure Returns the low byte of the passed integer
LoLong Procedure Returns the low long of the passed double
LongToDbl Procedure This routine converts a Long value to a Double value, treating the long as unsigned. For example, performing the following assignment dblNumber = -1 assigns -1 to the variable dblNumber. However, This assignment dblNumber = LongToDbl(-1) assigns 4,294,967,295 to dblNumber.
LongToInt Procedure Perform an unsigned conversion from a Long value to an integer value
LoWord Procedure Returns the low integer of the passed long
MakeDbl Procedure Combines two longs into a double. This routine correctly handles negative input Values
MakeInt Procedure Combines two bytes into an integer.
MakeLong Procedure Combines two words (integers) into a long. This routine correctly handles negative input Values
Shlb Procedure Shifts a numeric value left the specified number of bits. Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
Shli Procedure Shifts a numeric value left the specified number of bits. Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
Shll Procedure Shifts a numeric Value left the specified number of bits. Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
Shrb Procedure Shifts a byte value right the selected number of places. Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result.
Shri Procedure Shifts a Long value right the selected number of places. Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result.
Shrl Procedure Shifts a Long value right the selected number of places. Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result.

Overview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence