SetBit - method of object Pm

Changing a bit of the variable.
SetBit(vFrom As Variant, nIndex As Integer, bValue As Boolean) As Variant
x = Pm.SetBit(vFrom, nIndex, bValue)
vFrom(Variant) Variable whose bit has to be changed. The variable must be integer (Byte, Integer, Long).
nIndex(Integer) Index of the bit in the variable (zero-based index).
bValue(Boolean) New value of the bit (true or false).
It doesn't change the value of the vFrom variable directly but it returns new value that can be put into the variable.
The method can also be called in the graphic item events for Web Panels.

In the JavaScript language, it is better to use the standard bit operators for setting and reading the bit.

Setting the 20th bit in the BitMask variable
BitMask = Pm.SetBit(CLng(BitMask), 20, true)
CLng is needed when originally the BitMask was not of the Long data type. If it has been, for example, Integer then the 20th bit of the value doesn't exist and the method would fail.
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- SetBit
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice