Display Enhancement Characters

BASIC uses certain characters as display enhancement characters. These characters do not occupy any space on the screen, nor do they produce any immediately visible effect. Display enhancement characters change the appearance of characters that follow.

Globalized BASIC defines both one- and two-byte display enhancement characters. Refer to the globalization chapters of HP BASIC Porting and Globalization for more information about two-byte characters.

PRINT CHR$(132);A$;CHR$(128)                                                                        underline on/off

PRINT CHR$(255)&CHR$(132);A$;CHR$(255)&CHR$(128)                           underline on/off

Monochrome Display Enhancements
Character Resulting Enhancement
One-byte Two-byte
CHR$(128) CHR$(255)&CHR$(128) All enhancements off
CHR$(129) CHR$(255)&CHR$(129) Inverse video on
CHR$(130) CHR$(255)&CHR$(130) Blinking on*
CHR$(131) CHR$(255)&CHR$(131) Inverse video and blinking on
CHR$(132) CHR$(255)&CHR$(132) Underline on
CHR$(133) CHR$(255)&CHR$(133) Underline and inverse video on
CHR$(134) CHR$(255)&CHR$(134) Underline and blinking on*
CHR$(135) CHR$(255)&CHR$(135) Underline, inverse video, and blinking on*

*Blinking not available on bit-mapped alpha displays.

Color Display Enhancements
Character Resulting Enhancement
One-byte Two-byte Model 236C Bit-mapped
CHR$(136) CHR$(255)&CHR$(136) White Pen 1
CHR$(137) CHR$(255)&CHR$(137) Red Pen 2
CHR$(138) CHR$(255)&CHR$(138) Yellow Pen 3
CHR$(139) CHR$(255)&CHR$(139) Green Pen 4
CHR$(140) CHR$(255)&CHR$(140) Cyan Pen 5
CHR$(141) CHR$(255)&CHR$(141) Blue Pen 6
CHR$(142) CHR$(255)&CHR$(142) Magenta Pen 7
CHR$(143) CHR$(255)&CHR$(143) Black Pen 8

CRT CONTROL registers 5 and 15 through 17 also provide a method of changing the alpha color.

PRINTing CHR$(x), where 136<x<143, will provide the same colors as on the Model 236C as long as the color map contains default values and the alpha write-enable mask includes planes 0 through 2. A user-defined color map which changes the values of pens 0 to 7 will change the meaning of CHR$(x).