Copyright (c) 2012-2016 Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Control Sequences"

From AmigaOS Documentation Wiki
Jump to: navigation, search
(Graphic Rendition Control Sequences)
(Examples)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
If an item is enclosed in square brackets, it is optional and may be omitted. For example, for '''Insert [N] Characters''' the value for '''N''' is shown as optional. The console device responds to such optional items by treating the value of '''N''' as 1 if it is not specified. The value of '''N''' or '''M''' is always a decimal number, having one or more ASCII digits to express its value.
+
A control sequence, also known as escape sequence, is a series of characters used for controlling console text output. When a control sequence is printed to a console window, text style or colors change. There are also control sequences for moving the cursor, erasing characters, clearing the console window, scrolling the console window content, and more.
 +
 
 +
The length of a control sequence varies from a single character to four character sequences. Some of the longer sequences contain one or two numeric parameters, which for example allow you to move the cursor for a supplied number of steps.
 +
 
 +
The parameters are marked in the sequence with letters '''N''' and '''M''', and they are expected to be replaced with a decimal number when the sequence is used. If '''N''' or '''M''' is enclosed in brackets, the parameter is optional and can be omitted. When the parameter is left out, the console uses a default value of 1.
 +
 
 +
{{Note|Parameters must be inserted in the control sequence as ASCII digits and not as hexadecimal numbers.}}
 +
For example to move the cursor forward 15 positions, the control sequence string ('''cs_cursor_fw''') must be constructed as follows:
 +
<syntaxhighlight lang="rexx">
 +
cs_cursor_fw = '9b'x || '15' || '43'x
 +
</syntaxhighlight>
 +
'''9B''' and '''43''' are hexadecimal values and '''15''' is an ASCII string.
 +
When the control sequence string is printed to the console, the cursor moves forward 15 positions:
 +
<syntaxhighlight lang="rexx">
 +
SAY cs_cursor_fw || 'Hello!'
 +
</syntaxhighlight>
  
 
= Console Control Sequences =
 
= Console Control Sequences =
 +
These control sequences allow you to move the cursor, erase characters, scroll the console window, control word wrapping, set console marginals, flash the screen, select graphic character set, set cursor properties, and change the line feed mode.
 
{| class="wikitable"
 
{| class="wikitable"
 
! style="text-align:left;" | Command
 
! style="text-align:left;" | Command
Line 21: Line 37:
 
| Carriage Return || Move cursor to the first column || 0D
 
| Carriage Return || Move cursor to the first column || 0D
 
|-
 
|-
| Shift In || Undo Shift Out || 0E
+
| Shift In || Use ASCII graphic characters || 0E
 +
|-
 +
| Shift Out || Use ECMA 94 Latin 1 graphic characters || 0F
 
|-
 
|-
| Shift Out || Set MSB of each character before displaying || 0F
+
| Esc || Escape || 1B
 
|-
 
|-
 
| Index || Move the active position down one line || 84
 
| Index || Move the active position down one line || 84
Line 32: Line 50:
 
|-
 
|-
 
| Reverse Index || Move the active position up one line || 8D
 
| Reverse Index || Move the active position up one line || 8D
 +
|-
 +
| CSI || Control sequence introducer || 9B
 
|-
 
|-
 
| Reset to defaults || Reset console to Initial State || 1B 63
 
| Reset to defaults || Reset console to Initial State || 1B 63
 
|-
 
|-
 
| Insert [N] Characters || Insert one or more spaces, shifting the remainder of the line to the right || 9B [N] 40
 
| Insert [N] Characters || Insert one or more spaces, shifting the remainder of the line to the right || 9B [N] 40
 +
|-
 +
| Cursor On || Show cursor || 9B 20 70
 +
|-
 +
| Cursor Off || Hide cursor || 9B 30 20 70
 
|-
 
|-
 
| Cursor Up [N] Positions || Move cursor up [N] character positions. Default is 1. || 9B [N] 41
 
| Cursor Up [N] Positions || Move cursor up [N] character positions. Default is 1. || 9B [N] 41
Line 93: Line 117:
  
 
= Graphic Rendition Control Sequences =
 
= Graphic Rendition Control Sequences =
 +
These control sequences allow you to change text style and colors.
  
 +
The available text styles are: plain, bold, italic, underscore, strike-through, reverse video, faint, blinking, and concealed. Styles can be mixed, i.e. you can print bold italic text or reverse video italic text, etc.
 +
 +
Character color (foreground color), character cell color (text background color) and console background color can be selected freely from an 8 pen palette. The palette pen colors can be changed through the '''Console Preferences Editor'''. See [[AmigaOS Manual:Console Preferences Editor|Console Preferences Editor]] for more information on the console colors.
 
{| class="wikitable"
 
{| class="wikitable"
 
! style="text-align:left;" | Command
 
! style="text-align:left;" | Command
Line 122: Line 150:
 
|-
 
|-
 
| Faint Off / Boldface Off || Return to normal text color. This will also turn boldface off. || 9B 32 32 6D
 
| Faint Off / Boldface Off || Return to normal text color. This will also turn boldface off. || 9B 32 32 6D
 +
|-
 +
| Slow Blink On || Start printing slowly blinking characters || 9B 35 6D
 +
|-
 +
| Slow Blink Off || Stop printing slowly blinking characters || 9B 32 35 6D
 +
|-
 +
| Fast Blink On || Start printing fast blinking characters || 9B 36 6D
 +
|-
 +
| Fast Blink Off || Stop printing fast blinking characters || 9B 32 36 6D
 
|-
 
|-
 
| Concealed On || Enter concealed mode. In the concealed mode chracters are not printed. || 9B 38 6D
 
| Concealed On || Enter concealed mode. In the concealed mode chracters are not printed. || 9B 38 6D
Line 127: Line 163:
 
| Concealed Off || Exit concealed mode || 9B 32 38 6D
 
| Concealed Off || Exit concealed mode || 9B 32 38 6D
 
|-
 
|-
| Cursor On || Show cursor || 9B 20 70
+
| Set Character Color || Select color 0 || 9B 33 30 6D
 
|-
 
|-
| Cursor Off || Hide cursor || 9B 30 20 70
+
| || Select color 1 || 9B 33 31 6D
 
|-
 
|-
| Slow Blink On || || ?
+
| || Select color 2 || 9B 33 32 6D
 
|-
 
|-
| Slow Blink Off || || ?
+
| || Select color 3 || 9B 33 33 6D
 
|-
 
|-
| Fast Blink On || || ?
+
| || Select color 4 || 9B 33 34 6D
 
|-
 
|-
| Fast Blink Off || || ?
+
| || Select color 5 || 9B 33 35 6D
 
|-
 
|-
| Set Character Color || || ?
+
| || Select color 6 || 9B 33 36 6D
 
|-
 
|-
| Reset Character Color || || ?
+
| || Select color 7 || 9B 33 37 6D
 
|-
 
|-
| Set Cell Color || || ?
+
| || Select default color || 9B 33 39 6D
 
|-
 
|-
| Reset Cell Color || || ?
+
| Set Character Cell Color || Select color 0 || 9B 34 30 6D
 
|-
 
|-
| Set Background Color || || ?
+
| || Select color 1 || 9B 34 31 6D
 +
|-
 +
| || Select color 2 || 9B 34 32 6D
 +
|-
 +
| || Select color 3 || 9B 34 33 6D
 +
|-
 +
| || Select color 4 || 9B 34 34 6D
 +
|-
 +
| || Select color 5 || 9B 34 35 6D
 +
|-
 +
| || Select color 6 || 9B 34 36 6D
 +
|-
 +
| || Select color 7 || 9B 34 37 6D
 +
|-
 +
| || Select default color || 9B 34 39 6D
 +
|-
 +
| Set Background Color || Select color 0 || 9B 3E 30 6D
 +
|-
 +
| || Select color 1 || 9B 3E 31 6D
 +
|-
 +
| || Select color 2 || 9B 3E 32 6D
 +
|-
 +
| || Select color 3 || 9B 3E 33 6D
 +
|-
 +
| || Select color 4 || 9B 3E 34 6D
 +
|-
 +
| || Select color 5 || 9B 3E 35 6D
 +
|-
 +
| || Select color 6 || 9B 3E 36 6D
 +
|-
 +
| || Select color 7 || 9B 3E 37 6D
 
|}
 
|}
  
Line 171: Line 237:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Print the same phrase using 7 different text styles:
+
Print the same phrase using 9 different text styles:
 
<syntaxhighlight lang="rexx">
 
<syntaxhighlight lang="rexx">
 
/* VARIABLES */
 
/* VARIABLES */
Line 189: Line 255:
 
cs_reverse_on    = '9b376d'x
 
cs_reverse_on    = '9b376d'x
 
cs_reverse_off    = '9b32376d'x
 
cs_reverse_off    = '9b32376d'x
 +
cs_slow_blink_on  = '9b356d'x
 +
cs_slow_blink_off = '9b32356d'x
 +
cs_fast_blink_on  = '9b366d'x
 +
cs_fast_blink_off = '9b32366d'x
  
 
/* Test text styles */
 
/* Test text styles */
Line 218: Line 288:
 
SAY cs_reverse_on || phrase || cs_reverse_off
 
SAY cs_reverse_on || phrase || cs_reverse_off
 
SAY ''
 
SAY ''
 +
 +
SAY cs_plain || 'Slowly blinking'
 +
SAY cs_slow_blink_on || phrase || cs_slow_blink_off
 +
SAY ''
 +
 +
SAY cs_plain || 'Fast blinking'
 +
SAY cs_fast_blink_on || phrase || cs_fast_blink_off
 +
SAY ''
 +
</syntaxhighlight>
 +
 +
Test console color features:
 +
<syntaxhighlight lang="rexx">
 +
/* VARIABLES */
 +
phrase            = 'The quick brown fox jumps over a lazy dog'
 +
cs_clear          = '0c'x
 +
cs_defchcolor    = '9b33396d'x /* Character colors */
 +
cs_chcolor.0      = '9b33306d'x
 +
cs_chcolor.1      = '9b33316d'x
 +
cs_chcolor.2      = '9b33326d'x
 +
cs_chcolor.3      = '9b33336d'x
 +
cs_chcolor.4      = '9b33346d'x
 +
cs_chcolor.5      = '9b33356d'x
 +
cs_chcolor.6      = '9b33366d'x
 +
cs_chcolor.7      = '9b33376d'x
 +
cs_defcccolor    = '9b34396d'x /* Character cell colors */
 +
cs_cccolor.0      = '9b34306d'x
 +
cs_cccolor.1      = '9b34316d'x
 +
cs_cccolor.2      = '9b34326d'x
 +
cs_cccolor.3      = '9b34336d'x
 +
cs_cccolor.4      = '9b34346d'x
 +
cs_cccolor.5      = '9b34356d'x
 +
cs_cccolor.6      = '9b34366d'x
 +
cs_cccolor.7      = '9b34376d'x
 +
cs_bgcolor.0      = '9b3e306d'x /* Background colors */
 +
cs_bgcolor.1      = '9b3e316d'x
 +
cs_bgcolor.2      = '9b3e326d'x
 +
cs_bgcolor.3      = '9b3e336d'x
 +
cs_bgcolor.4      = '9b3e346d'x
 +
cs_bgcolor.5      = '9b3e356d'x
 +
cs_bgcolor.6      = '9b3e366d'x
 +
cs_bgcolor.7      = '9b3e376d'x
 +
 +
SAY cs_clear || '---  Character Color  ---'
 +
DO color = 0 TO 7
 +
    SAY cs_defchcolor || color || ': ' || cs_chcolor.color || phrase || cs_defchcolor
 +
END
 +
SAY ''
 +
 +
SAY '---  Character Cell Color  ---'
 +
DO color = 0 TO 7
 +
    SAY cs_defcccolor || color || ': ' || cs_cccolor.color || phrase || cs_defcccolor
 +
END
 +
SAY ''
 +
 +
SAY '---  Background Color  ---'
 +
SAY ''
 +
SAY 'Press enter to change the background color.'
 +
SAY ''
 +
DO color = 0 TO 7
 +
    SAY color || ':'
 +
END
 +
SAY COPIES( '0b'x, 8 + 1 )
 +
DO color = 0 TO 7
 +
    OPTIONS PROMPT cs_defchcolor || cs_defcccolor || color || ': '
 +
    PARSE PULL key
 +
    SAY '0b'x || color || ': Using background color ' || color || '.' || cs_bgcolor.color
 +
END
 +
SAY ''
 +
OPTIONS PROMPT cs_defchcolor || cs_defcccolor || 'Press enter to exit.'
 +
PARSE PULL key
 +
SAY cs_bgcolor.0
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 18:49, 5 January 2018

A control sequence, also known as escape sequence, is a series of characters used for controlling console text output. When a control sequence is printed to a console window, text style or colors change. There are also control sequences for moving the cursor, erasing characters, clearing the console window, scrolling the console window content, and more.

The length of a control sequence varies from a single character to four character sequences. Some of the longer sequences contain one or two numeric parameters, which for example allow you to move the cursor for a supplied number of steps.

The parameters are marked in the sequence with letters N and M, and they are expected to be replaced with a decimal number when the sequence is used. If N or M is enclosed in brackets, the parameter is optional and can be omitted. When the parameter is left out, the console uses a default value of 1.

Note
Parameters must be inserted in the control sequence as ASCII digits and not as hexadecimal numbers.

For example to move the cursor forward 15 positions, the control sequence string (cs_cursor_fw) must be constructed as follows:

cs_cursor_fw = '9b'x || '15' || '43'x

9B and 43 are hexadecimal values and 15 is an ASCII string. When the control sequence string is printed to the console, the cursor moves forward 15 positions:

SAY cs_cursor_fw || 'Hello!'

Console Control Sequences

These control sequences allow you to move the cursor, erase characters, scroll the console window, control word wrapping, set console marginals, flash the screen, select graphic character set, set cursor properties, and change the line feed mode.

Command Comment Sequence of Characters (in Hexadecimal Form)
Bell Flash the display 07
Backspace Move cursor left one column 08
Horizontal Tab Move cursor right one tab stop 09
Line Feed Move cursor down one text line 0A
Vertical Tab Move cursor up one text line 0B
Form Feed Clear the console’s window 0C
Carriage Return Move cursor to the first column 0D
Shift In Use ASCII graphic characters 0E
Shift Out Use ECMA 94 Latin 1 graphic characters 0F
Esc Escape 1B
Index Move the active position down one line 84
Next Line Go to the beginning of the next line 85
Horizontal Tabulation Set a tab at the active cursor position 88
Reverse Index Move the active position up one line 8D
CSI Control sequence introducer 9B
Reset to defaults Reset console to Initial State 1B 63
Insert [N] Characters Insert one or more spaces, shifting the remainder of the line to the right 9B [N] 40
Cursor On Show cursor 9B 20 70
Cursor Off Hide cursor 9B 30 20 70
Cursor Up [N] Positions Move cursor up [N] character positions. Default is 1. 9B [N] 41
Cursor Down [N] Positions Move cursor down [N] character positions. Default is 1. 9B [N] 42
Cursor Forward [N] Positions Move cursor forward [N] character positions. Default is 1. 9B [N] 43
Cursor Backward [N] Positions Move cursor backward [N] character positions. Default is 1. 9B [N] 44
Set Cursor Position Where [N] is row, [M] is column, and semicolon (hex 3B) must be present as a separator, or if row is left out, so the console device can tell that the number after the semicolon actually represents the column number. 9B [N] [3B M] 48
Cursor Horizontal Tabulation Move cursor forward [N] tab positions. 9B [N] 49
Cursor Next Line [N] Move cursor [N] lines down. Cursor column is set to 1. 9B [N] 45
Cursor Preceding Line [N] Move cursor [N] lines up. Cursor column is set to 1. 9B [N] 46
Erase in Display Clear at end of the display starting from the current cursor position. 9B 4A
Erase in Line Clear at the end of the line starting from the current cursor position. 9B 4B
Insert Line Insert a line above the line containing the cursor. 9B 4C
Delete Line Remove the current line, move all lines up one position to fill gap, and blank the bottom line. 9B 4D
Delete Character [N] Delete the character that the cursor is sitting on and [N] characters to the right of the cursor. 9B [N] 50
Scroll up [N] Lines Remove line(s) from the top of the console window, move all other lines up, and blank [N] bottom lines. 9B [N] 53
Scroll down [N] Lines Remove line(s) from the bottom of the console window, move all other lines down, and blank [N] top lines. 9B [N] 54
Cursor Tabulation Control Controls the cursor tabulation: when [N] = 0, set tab; when [N] = 2, clear tab; and when [N] = 5, clear all tabs. 9B [N] 57
Cursor Backward Tabulation Move cursor backward [N] tab positions. 9B [N] 5A
Set Line Feed Mode Cause Line Feed to respond as Return + Line Feed. 9B 32 30 68
Reset Newline Mode Cause Line Feed to respond only as Line Feed. 9B 32 30 6C
Enable Scroll Enable scrolling. This is the default setting. 9B 3E 31 68
Disable Scroll Disable scrolling 9B 3E 31 6C
Autowrap On Enable word wrapping. This is the default setting. 9B 3F 37 68
Autowrap Off Disable word wrapping 9B 3F 37 6C
Set Page Length to N In character raster lines, causes console to recalculate, using current font, how many text lines will fit on the page 9B N 74
Set Line Length to N In character positions, using current font, how many characters should be placed on each line 9B N 75
Set Left Offset to N In raster columns, how far from the left of the window should the text begin 9B N 78
Set Top Offset to N In raster lines, how far from the top of the window’s RastPort should the topmost line of the character begin 9B N 79

Graphic Rendition Control Sequences

These control sequences allow you to change text style and colors.

The available text styles are: plain, bold, italic, underscore, strike-through, reverse video, faint, blinking, and concealed. Styles can be mixed, i.e. you can print bold italic text or reverse video italic text, etc.

Character color (foreground color), character cell color (text background color) and console background color can be selected freely from an 8 pen palette. The palette pen colors can be changed through the Console Preferences Editor. See Console Preferences Editor for more information on the console colors.

Command Comment Sequence of Characters (in Hexadecimal Form)
Plain Text Plain text 9B 30 6D
Boldface On Bolded 9B 31 6D
Italic On Italics 9B 33 6D
Italic Off Italics off 9B 32 33 6D
Underscore On Underlined 9B 34 6D
Underscore Off Underlined off 9B 32 34 6D
Strike-Through On 9B 39 6D
Strike-Through Off 9B 32 39 6D
Reverse Video On 9B 37 6D
Reverse Video Off 9B 32 37 6D
Faint On Faint (secondary text color) 9B 32 6D
Faint Off / Boldface Off Return to normal text color. This will also turn boldface off. 9B 32 32 6D
Slow Blink On Start printing slowly blinking characters 9B 35 6D
Slow Blink Off Stop printing slowly blinking characters 9B 32 35 6D
Fast Blink On Start printing fast blinking characters 9B 36 6D
Fast Blink Off Stop printing fast blinking characters 9B 32 36 6D
Concealed On Enter concealed mode. In the concealed mode chracters are not printed. 9B 38 6D
Concealed Off Exit concealed mode 9B 32 38 6D
Set Character Color Select color 0 9B 33 30 6D
Select color 1 9B 33 31 6D
Select color 2 9B 33 32 6D
Select color 3 9B 33 33 6D
Select color 4 9B 33 34 6D
Select color 5 9B 33 35 6D
Select color 6 9B 33 36 6D
Select color 7 9B 33 37 6D
Select default color 9B 33 39 6D
Set Character Cell Color Select color 0 9B 34 30 6D
Select color 1 9B 34 31 6D
Select color 2 9B 34 32 6D
Select color 3 9B 34 33 6D
Select color 4 9B 34 34 6D
Select color 5 9B 34 35 6D
Select color 6 9B 34 36 6D
Select color 7 9B 34 37 6D
Select default color 9B 34 39 6D
Set Background Color Select color 0 9B 3E 30 6D
Select color 1 9B 3E 31 6D
Select color 2 9B 3E 32 6D
Select color 3 9B 3E 33 6D
Select color 4 9B 3E 34 6D
Select color 5 9B 3E 35 6D
Select color 6 9B 3E 36 6D
Select color 7 9B 3E 37 6D

Examples

Flash the screen:

SAY '07'x

Clear the console window:

SAY '0c'x

Display a progress indicator utilizing the Vertical Tab:

SAY ''
DO index = 0 TO 100 BY 5
   SAY '0b'x || 'Processing: ' || index || '%'
   ADDRESS command 'Wait 1'
END

Print the same phrase using 9 different text styles:

/* VARIABLES */
phrase            = 'The quick brown fox jumps over a lazy dog'
cs_clear          = '0c'x
cs_plain          = '9b306d'x
cs_bold_on        = '9b316d'x
cs_bold_off       = '9b32326d'x
cs_italic_on      = '9b336d'x
cs_italic_off     = '9b32336d'x
cs_strike_on      = '9b396d'x
cs_strike_off     = '9b32396d'x
cs_underscore_on  = '9b346d'x
cs_underscore_off = '9b32346d'x
cs_faint_on       = '9b326d'x
cs_faint_off      = cs_bold_off
cs_reverse_on     = '9b376d'x
cs_reverse_off    = '9b32376d'x
cs_slow_blink_on  = '9b356d'x
cs_slow_blink_off = '9b32356d'x
cs_fast_blink_on  = '9b366d'x
cs_fast_blink_off = '9b32366d'x
 
/* Test text styles */
SAY cs_clear || cs_plain || 'Plain'
SAY cs_plain || phrase
SAY ''
 
SAY cs_plain || 'Bold'
SAY cs_bold_on || phrase || cs_bold_off
SAY ''
 
SAY cs_plain || 'Italic'
SAY cs_italic_on || phrase || cs_italic_off
SAY ''
 
SAY cs_plain || 'Strike-through'
SAY cs_strike_on || phrase || cs_strike_off
SAY ''
 
SAY cs_plain || 'Underscore'
SAY cs_underscore_on || phrase || cs_underscore_off
SAY ''
 
SAY cs_plain || 'Faint'
SAY cs_faint_on || phrase || cs_faint_off
SAY ''
 
SAY cs_plain || 'Reverse Video'
SAY cs_reverse_on || phrase || cs_reverse_off
SAY ''
 
SAY cs_plain || 'Slowly blinking'
SAY cs_slow_blink_on || phrase || cs_slow_blink_off
SAY ''
 
SAY cs_plain || 'Fast blinking'
SAY cs_fast_blink_on || phrase || cs_fast_blink_off
SAY ''

Test console color features:

/* VARIABLES */
phrase            = 'The quick brown fox jumps over a lazy dog'
cs_clear          = '0c'x
cs_defchcolor     = '9b33396d'x /* Character colors */
cs_chcolor.0      = '9b33306d'x
cs_chcolor.1      = '9b33316d'x
cs_chcolor.2      = '9b33326d'x
cs_chcolor.3      = '9b33336d'x
cs_chcolor.4      = '9b33346d'x
cs_chcolor.5      = '9b33356d'x
cs_chcolor.6      = '9b33366d'x
cs_chcolor.7      = '9b33376d'x
cs_defcccolor     = '9b34396d'x /* Character cell colors */
cs_cccolor.0      = '9b34306d'x
cs_cccolor.1      = '9b34316d'x
cs_cccolor.2      = '9b34326d'x
cs_cccolor.3      = '9b34336d'x
cs_cccolor.4      = '9b34346d'x
cs_cccolor.5      = '9b34356d'x
cs_cccolor.6      = '9b34366d'x
cs_cccolor.7      = '9b34376d'x
cs_bgcolor.0      = '9b3e306d'x /* Background colors */
cs_bgcolor.1      = '9b3e316d'x
cs_bgcolor.2      = '9b3e326d'x
cs_bgcolor.3      = '9b3e336d'x
cs_bgcolor.4      = '9b3e346d'x
cs_bgcolor.5      = '9b3e356d'x
cs_bgcolor.6      = '9b3e366d'x
cs_bgcolor.7      = '9b3e376d'x
 
SAY cs_clear || '---  Character Color  ---'
DO color = 0 TO 7
    SAY cs_defchcolor || color || ': ' || cs_chcolor.color || phrase || cs_defchcolor
END
SAY ''
 
SAY '---  Character Cell Color  ---'
DO color = 0 TO 7
    SAY cs_defcccolor || color || ': ' || cs_cccolor.color || phrase || cs_defcccolor
END
SAY ''
 
SAY '---  Background Color  ---'
SAY ''
SAY 'Press enter to change the background color.'
SAY ''
DO color = 0 TO 7
    SAY color || ':'
END
SAY COPIES( '0b'x, 8 + 1 )
DO color = 0 TO 7
    OPTIONS PROMPT cs_defchcolor || cs_defcccolor || color || ': '
    PARSE PULL key
    SAY '0b'x || color || ': Using background color ' || color || '.' || cs_bgcolor.color
END
SAY ''
OPTIONS PROMPT cs_defchcolor || cs_defcccolor || 'Press enter to exit.'
PARSE PULL key
SAY cs_bgcolor.0