## ▄CC Console Control

The monadic system function ▄CC provides terminal-control facilities. With the exception of arbitrary output each ▄CC operation is identified by a numeric code or code list which is included as the right argument to ▄CC. The typical form of a ▄CC expression is:

                 RESULT└▄CC OPERATION

where RESULT is the result of the operation and OPERATION is the appropriate code or code list. The numbers used as the right argument to ▄CC must be integers (whole numbers). The ▄CC operation specified is carried out, and in most cases an empty vector is returned as the result.

### System Dependent

▄CC is highly system dependent. On console-mode (dumb-terminal) implementations of APLX ▄CC controls the user's terminal display. On windowing implementations (APLX for Windows and APLX for MacOS), it controls the Session window.

### Single key input with ▄CC

                 RESULT└▄CC ╞1

The code, ╞1, specifies that the next character entered on the keyboard is to be assigned to the named variable. No input translation takes place.

If the next key hit after the above statement has been executed is 'Z', then RESULT will contain 'Z'.

### Arbitrary output with ▄CC

                 RESULT└▄CC TEXT

The characters in the right argument are output to the screen without output translation. RESULT is an empty vector with display potential off.

### Cursor addressing with ▄CC

                 RESULT└▄CC 0 R C

You can move the cursor to a particular line and character position, by using the code 0, followed by the numbers of the row and column you require. Rows and columns start at 0. Invalid cursor positions are ignored.

The result of ▄CC is an empty vector with display potential off.

                 [3]  ▄CC 0 10 20 ╙ 'HELLO'

The cursor moves to row 10 column 20 and the text string 'HELLO' is printed.

### Basic screen control with ▄CC

Each of the following operations can be invoked by a statement of the form:

                 RESULT└▄CC code(s)

The required operation is carried out. The result returned by the operation is in most cases an empty vector with display potential off. (An exception is ▄CC 20 which returns a numeric vector consisting of three elements.) Multiple codes can be output at one time (up to a maximum of 50), but all must be integers.

                 RESULT└▄CC 20

Returns a three element vector which contains the row and column where the cursor is positioned and the screen width.

The complete list of ▄CC codes is as follows. Codes marked with an asterisk * are NOT implemented on the Windows, MOTIF or MacOS systems.

    зннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннннл
    ш                        Operations Performed by ▄CC                             ш
    цннннннннннннннннннннннннннннннннннннннннннбнннннннннннннннннннннннннннннннннннннщ
    ш Code Operation                           ш Code   Operation                    ш
    цннннннннннннннннннннннннннннннннннннннннннонннннннннннннннннннннннннннннннннннннщ
    ш 1    Clear Screen                        ш   19   Insert Character             ш
    ш 2    Home cursor                         ш   20   Read Curs. Pos, Screen Width ш
    ш 3    Cursor to beginning of line         ш   21   Insert Mode On               ш
    ш 4    Move Cursor Up One Line             ш   22   Insert Mode Off              ш
    ш 5    Move Cursor Down One Line           ш   23 * Half Intensity On            ш
    ш 6    Move Cursor Left One Position       ш   24 * Half Intensity Off           ш
    ш 7    Move Cursor Right One Position      ш   29 * Underlined characters On     ш
    ш 8    APL character set                   ш   30 * Underlined Characters Off    ш
    ш 9    ASCII character set                 ш   31 * Reverse Screen Video         ш
    ш 10   Erase from Cursor to End of Line    ш   32 * Normal Screen Video          ш
    ш 11   Erase from Cursor to End of Screen  ш   33 * Select 80  Columns           ш
    ш 12 * Protect Characters On               ш   34 * Select 132 Columns           ш
    ш 13 * Protect Characters Off              ш   35   Bell (Audible Alarm)         ш
    ш 14 * Protection On                       ш   36   Bold Text On                 ш
    ш 15 * Protection Off                      ш   37   Bold Text Off                ш
    ш 16   Delete Line                         ш   38   Italic Text On               ш
    ш 17   Insert Line                         ш   39   Italic Text Off              ш
    ш 18   Delete Character                    ш                                     ш
    юннннннннннннннннннннннннннннннннннннннннннаннннннннннннннннннннннннннннннннннннны

On implementations which support color display, the following codes are also implemented:

    зннннннннннннннннннннннннннннннннннннннннннл
    ш 101   Black text                         ш
    ш 102   White text                         ш
    ш 103   Red text                           ш
    ш 104   Green text                         ш
    ш 105   Blue text                          ш
    ш 106   Cyan text                          ш
    ш 107   Magenta text                       ш
    ш 108   Yellow text                        ш
    юнннннннннннннннннннннннннннннннннннннннннна

Other code numbers are reserved.

The operations which ▄CC can perform depend on the capabilities of the terminal and/or system, but the following operations are almost always available:

                 1 2 3 4 5 6 7 10 11 20

                 ▓ TEST
           [1]  ╘ EXAMPLE OF ▄CC USAGE
           [2]  ▄CC 1 2 ╘          CLEAR SCREEN AND HOME TO SET ▄CC (IF NEEDED)
           [3]  ▄CC 0 10 10
           [4]  POSITION └▄CC 20
           [5]  ▄CC 29 ╘           UNDERLINE ON
           [6]  'I AM AT POSITION ',POSITION
           [7]  ▄CC 30   ╘         UNDERLINE OFF
           [8]  ▓

Topic: APLX Help : Help on APL language : System Functions & Variables : ▄CC Console Control

[ Previous | Next | Contents | Index ]