ANSI Codes
Home Up Feedback Contents Search

                  ANSI.SYS and NANSI.SYS Functions  (x3.64)                   

       ESC [ y,x H    Cursor position y,x
       ESC [ n A      Cursor Up n lines
       ESC [ n B      Cursor Down n lines
       ESC [ n C      Cursor Forward n characters
       ESC [ n D      Cursor Backward n characters
       ESC [ y;x f    Cursor position y,x (less frequently used)
       ESC [ y;x R    Cursor position report y,x
       ESC [ 6 n      Device status report (cursor pos)(n is constant 'n')
       ESC [ s        Save cursor position
       ESC [ u        Restore cursor position
       ESC [ 2 J      Erase display
       ESC [ K        Erase to end of line
       ESC [ n L      Inserts n blank lines at cursor line.   (NANSI)
       ESC [ n M      Deletes n lines including cursor line.  (NANSI)
       ESC [ n @      Inserts n blank chars at cursor.        (NANSI)
       ESC [ n P      Deletes n chars including cursor char.  (NANSI)

       ESC [ n;n y    Output char translate                   (NANSI)
                      When first char is encountered in output request,
                      it is replaced with the second char.  When no
                      parameters are given, all chars are reset.
       ESC [ "str" p  Keyboard Key Reassignment. The first char of
                      str gives the key to redefine; the rest of the
                      string is the key's new value.  To specify
                      unprintable chars, give the ASCII value of the
                      char outside of quotes, as a normal parameter.
                      IBM function keys are two byte strings.

                      Ex:  ESC [ 0 ; ";dir a:" ; 13 ; p

                      redefines F1 to have the value "dir a:" followed
                      by ENTER.   If no parameters given, all keys are
                      reset to their default values.   Single or double
                      quotes may be used.

       ESC [ n;n;...n m  Set Graphics Rendition is used to set attributes as
           well as foreground and background colors.  If multiple parameters
           are used, they are executed in sequence, and the effects are
           cumulative. 'n' is one of the following attributes or colors:

             0  All attributes off       5  Blink
             1  Bold                     7  Reverse Video
             2  Dim                      8  Invisible
             4  Underline

           Foreground colors          Background colors
              30  Black                  40  Black
              31  Red                    41  Red
              32  Green                  42  Green
              33  Yellow                 43  Yellow
              34  Blue                   44  Blue
              35  Magenta                45  Magenta
              36  Cyan                   46  Cyan
              37  White                  47  White

       ESC [ = n h     Set mode (see screen modes for n)
       ESC [ = n l     Reset Mode (see screen modes for n)

          Screen modes are similar to those found in the IBM BIOS:

              0   text 40x25 Black & White
              1   text 40x25 Color
              2   text 80x25 Black & White
              3   text 80x25 Color
              4   320x200 4 bits/pixel
              5   320x200 1 bit/pixel
              6   640x200 1 bit/pixel
              7   cursor wrap
             13   320x200 4 bits/pixel (EGA)
             14   640x200 4 bits/pixel (EGA)
             16   640x350 4 bits/pixel (EGA)

       - for more information see ANSI document x3.64 or DOS manual


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .