5-18 Command Reference
BITTEST
Purpose Checks the specified bit to see if the bit is a one or a zero.
Syntax BITTEST
buffer-field1
,
bit-position
[ , [
invalid label
] [ ,
valid label
] ]
Process The BITTEST command checks the specified bit by
bit-position
in
buffer-field1
.
Bit-
position
can be 0 to 15. If the bit specified by
bit-position
is zero (cleared) and
invalid label
is defined, control passes to that label. If the bit specified by
bit-
position
is one (set) and
valid label
is defined, control passes to that label.
Buffer-field1
and
bit-position
can be one of the following:
Buffer-field1
and
bit-position
Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
Asc-field only:
Number
String
A number prefixed by
the number sign (#)
ASCII string delimited
by double quotes
SCRATCH Scratch buffer
Optional Fields
Invalid
and
valid labels
are discussed in “Script Flow" at the beginning this chapter.
Example
This example checks bit number two of TEMP1 and if it is zero (cleared), control
passes to CLEARED. If the bit is one (set), control passes to the next line.
BITTEST TEMP1, #2, *CLEARED
See Also BITCLEAR
BITMASK
BITSET
BITSHIFT