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 is performed in Power2()    BitSet = (value Or Power2(bit))End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: