Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1449

Multi Bit Manipulation Class

$
0
0
This submission is a class that handles bit manipulation in the following VB data types: Byte, Integer, Long, Single, Double, Currency, Date and One dimensional Long Arrays. (These are VarTypes 2 thru 7, 17, and 8195.)

One of the nice features is that all these data types use the same interface. You can find the class here (on PSC). I keep it there so that there is only one source that I need to keep track of.

Some of the features include:

Sign bit is manipulated same as other bits.

Long arrays are in place of Decimals.
Any size long array can be made to act like a single bitfield (even shifting and rotating them).

You can insert numeric values into a bit field making for a 'hybrid' bitfield.

The class uses GetMem/PutMem & CopyBytes for various memory movements.

The class also optionally uses direct casting for some numeric types and strings. (The idea came from a Bonnie West class.)

The class is intended as a sort of "Swiss-Army-Knife" for bit manipulation. A more complete description can be found at the link and in the remarks in the class.

Any advice, ideas, or improvements would be more than welcome so as to improve it.

rdee

Viewing all articles
Browse latest Browse all 1449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>