GetBit - method of the Pm object
Description:
Returns a value of the variable bit.
Syntax:
Boolean GetBit(Variant Value, Long nIndex)
Parameters:
Value | (Variant) The value whose bit has to be checked up. This value must be integer (Byte, Integer, Long). |
nIndex | (Long) Index of the bit in the variable (zero-based index). |
---|
Return value:
Return value true is here not -1, but 1 because the experience shows it more practical in this case.
1 - bit is set
0 - bit is not set
Example:
Detects the value of the bit 20 in the BitMask variable
JavaScriptVBScriptSelect and copy to clipboard
if (Pm.GetBit(BitMask, 20))
{
// ... An action if the bit is set
}
If Pm.GetBit(BitMask, 20) Then
' ... An action if the bit is set
End If