GetBit

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender.

Description

Returns the value of the bit at the specified position in a bitmask. Bit indices start at 0 and should not be greater than 20- higher values are unreliable and prone to conversion.

Syntax

[help]
(bool) GetBit BitMask:int BitIndex:int 

Example

int BitMask
int BitTwo

set BitMask to 11		  ; binary: 00001011
set BitTwo to GetBit BitMask, 1   ; 1

See Also