×
Menu
Index

TXSETATTR Subroutine

 
Usage:
TXSETATTR (attribute)
 
Description:
Sets the current text attribute to use on the next TX output subroutine. It's common to use a hexadecimal number when specifying attributes due to the clarity it provides.
For example, white text on a blue background would be specified as 0x1F (1 being blue and F (15) being white).
 
 
Text Attribute 8-Bit Encoding
Bits
Usage
0-3
foreground color (0 to 15)
4-6
background color (0 to 7)
7
blink-enable bit
 
Standard Colors
Value
Description
0
Black
1
Blue
2
Green
3
Cyan
4
Red
5
Magenta
6
Brown
7
Light Gray
8
Dark Gray
9
Light Blue
10
Light Green
11
Light Cyan
12
Light Red
13
Light Magenta
14
Yellow
15
White
 
Example:
sub main()
   txinit()
   txsetattr(0x1F) // set white text on blue background
   printl("This prints in color")
   txterm()
end sub