BITCHANGE Function
Toggles the state of the specified bit in the bit table and returns the value of the bit before it was changed.
Syntax
BITCHANGE(bitNumber)
Syntax Elements
bitNumber Specifies the bit to be changed.
Operation
BITCHANGE operates on a table of 128 bits, numbered 1 to 128, unique to each process. Each bit is available as a two-state flag, that is, the value returned by the function is always either zero or one.
Because BITCHANGE returns the value of the bit before it was changed, the function of checking-and-setting (or resetting) a flag can be accomplished in one step.
Special functions can be performed by setting bitNumber to the following values:
-1 Allows access to the system INHIBIT bit (which controls inhibiting of the BREAK key).
-2 Allows access to the system TRSTRFLG bit (which controls TCL restart).
-3 Allows access to the system RSTRTFLG bit (which controls BREAK-END restart).
If bitNumber is 0, less than -3, or greater than 128, the bit table remains unchanged and BITCHANGE returns 0.
See Also
BITCHECK function, BITLOAD function, BITRESET function, BITSET function.
Example 1
If bit 100 = 0,
X = BITCHANGE(100)
PRINT X
sets bit 100 to 1 and prints 0.
Example 2
If bit 68 = 1,
A = BITCHANGE(68)
PRINT A
sets bit 68 to 0 and prints 1.