BITSET Function
Sets the value of the specified bit in the bit table to 1 and returns the value of the bit before it was changed.
Syntax
BITSET(bitNumber)
Syntax Elements
bitNumber Specifies the bit to be set.
If bitNumber evaluates to zero, all elements in the table are cleared and the returned value is zero.
Operation
BITSET 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 either zero or one.
Because BITSET 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:
0Clears the entire table.
-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 less than -3, or greater than 128, the bit table remains unchanged and BITSET returns 0.
See Also
BITCHANGE function, BITCHECK function, BITLOAD function, BITRESET function.
Example 1
If bit 10 = 1
STATUS = BITSET(10)
PRINT STATUS
sets the bit to 1 and prints 1.
Example 2
If bit 48 = 0
J = BITSET(48)
PRINT J
sets bit 48 to 1 and prints 0.