home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / sysutl / ansi_sys.arc / ANSI-SYS.DEM next >
Text File  |  1985-07-08  |  9KB  |  402 lines

  1.                   ANSI.SYS
  2.                   ~~~~~~~~
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                Sample CONFIG.SYS file
  10.               -----------------------
  11.              | DEVICE = MOUSE.SYS     |
  12.              | DEVICE = CLOCK.SYS     |
  13.              | DEVICE = HARDDISK.SYS |
  14.              | DEVICE = RAMDISK.SYS  |
  15.               -----------------------
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.                  DEVICE = ANSI.SYS
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. The syntax for PROMPT is:
  51.  
  52.  
  53.                 PROMPT [prompt-text]
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                    PROMPT $e[ ...
  60.  
  61.  
  62. Making the syntax:
  63.  
  64.  
  65.          PROMPT $e[<parameter>;...;<parameter><identifier>
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. The syntax we want is:
  75.  
  76.              PROMPT $e[<row>;<column>f
  77.  
  78.  
  79.  
  80. Move to the beginning of the last line of the screen, (row 25, column 1),
  81. the command would read:
  82.  
  83.  
  84.                   PROMPT $e[25;1f
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.                   Cursor Movement
  97.       -------------------------------------------------------
  98.      | CUU - CUrsor Up    - PROMPT $e[<number of rows>A     |
  99.      | CUD - CUrsor Down    - PROMPT $e[<number of rows>B     |
  100.      | CUF - CUrsor Forward - PROMPT $e[<number of columns>C |
  101.      | CUB - CUrsor Back    - PROMPT $e[<number of columns>D |
  102.       -------------------------------------------------------
  103.  
  104.  
  105.  
  106.             Find Current Cursor Position
  107.      ----------------------------------------------------------
  108.     | DSR - Device Status Report   - PROMPT $e[6n           |
  109.     | CPR - Cursor Position Report - PROMPT $e[<row>;<column>R |
  110.      ----------------------------------------------------------
  111.        DSR is your query of the device - CPR is the response
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.                  Cursor Positioning
  121.      ------------------------------------------------------------------
  122.     | CUP - CUrsor Position           - PROMPT $e[<row>;<column>H |
  123.     | HVP - Horizontal & Vertical Position - PROMPT $e[<row>;<column;f |
  124.     | SCP - Save Cursor Position       - PROMPT $e[s           |
  125.     | RCP - Restore Cursor Position       - PROMPT $e[u           |
  126.      ------------------------------------------------------------------
  127.  
  128.  
  129.  
  130.                   Erasing
  131.           ---------------------------------------
  132.          | ED  - Erase in Display - PROMPT $e[2J |
  133.          | EL  - Erase in Line      - PROMPT $e[k  |
  134.           ---------------------------------------
  135.  
  136.  
  137.  
  138.  
  139.  
  140.              Setting the Display Modes
  141.            ---------------------------------------------
  142.           |  SM  - Set Mode   - PROMPT $e[=<parameter>h |
  143.           |  RM  - Reset Mode - PROMPT $e[=<parameter>l |
  144.            ---------------------------------------------
  145.            |           parameter list           |
  146.            |           ~~~~~~~~~~~~~~           |
  147.            | 0      -    40x25 black and white   |\
  148.            | 1      -    40x25 color           | \  Text
  149.            | 2      -    80x25 black and white   | / Screens
  150.            | 3      -    80x25 color           |/
  151.            | 4      -    320x200 color           |\
  152.            | 5      -    320x200 black and white | > Graphic
  153.            | 6      -    640x200 black and white |/  Screens
  154.            | 7      -    if SM, word wrap is on  |
  155.            |           if RM, word wrap is off |
  156.             -----------------------------------
  157.  
  158. For a 40 column black and white display, the code sequence would be:
  159.  
  160.                 PROMPT $e[=0
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. color display with 80 columns, the sequence becomes:
  170.  
  171.  
  172.  
  173.                 PROMPT $e[=3
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.             Setting Color and Intensity
  187.   -----------------------------------------------------------------------
  188.  | SGR - Set Graphics Rendition - PROMPT $e[<parameter>;...;<parameter>m |
  189.   -----------------------------------------------------------------------
  190.          |               parameter list             |
  191.          |               ~~~~~~~~~~~~~~             |
  192.          | 0    -     normal attributes (default display) |
  193.          | 1    -     bold on (high intensity)         |
  194.          | 4    -     underline on (monochrome only)      |
  195.          | 5    -     blink on                 |
  196.          | 7    -     reverse video on             |
  197.          | 8    -     canceled on (invisible)         |
  198.          | 30   -     black characters             |
  199.          | 31   -     red characters              |
  200.          | 32   -     green characters             |
  201.          | 33   -     yellow characters             |
  202.          | 34   -     blue characters             |
  203.          | 35   -     magenta characters             |
  204.          | 36   -     cyan characters             |
  205.          | 37   -     white characters             |
  206.          |                             |
  207.          |                             |
  208.          |                             |
  209.          |                             |
  210.          | 40   -     black background             |
  211.          | 41   -     red background              |
  212.          | 42   -     green background             |
  213.          | 43   -     yellow background             |
  214.          | 44   -     blue background             |
  215.          | 45   -     magenta background             |
  216.          | 46   -     cyan background             |
  217.          | 47   -     white background             |
  218.           -----------------------------------------------
  219.  
  220. blue background with red characters displayed in high intensity:
  221.  
  222.                  PROMPT $e[44;31;1m
  223.  
  224. or for blue characters on a light yellow background:
  225.  
  226.                  PROMPT $e[34;43;7m
  227.  
  228.  
  229.  
  230.  
  231.  
  232. The syntax for its use is:
  233.  
  234.                 COLOR <your choice>
  235.  
  236.  
  237.                  COLOR.BAT
  238.               --------------------------------
  239.              | if %1 == red prompt $e[31m     |
  240.              | if %1 == green prompt $e[32m   |
  241.              | if %1 == yellow prompt $e[33m  |
  242.              | if %1 == blue prompt $e[34m    |
  243.              | if %1 == magenta prompt $e[35m |
  244.              | if %1 == cyan prompt $e[36m    |
  245.              | if %1 == white prompt $e[37m   |
  246.              | prompt                  |
  247.               --------------------------------
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255. Redefining the Keyboard
  256.  
  257.  
  258.  
  259. the basic control sequence you need for keyboard redefinition:
  260.  
  261.  
  262.  
  263.  
  264.  
  265.             PROMPT $e[<number>;<number>p
  266.  
  267.  
  268.  
  269.  
  270.                   PROMPT $e[65;66p
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.             PROMPT $e[<number>;"string"p
  287.  
  288.  
  289.  
  290.  
  291.  
  292.                PROMPT $e[122;"zebra"p
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.         PROMPT $e[0;<number>;"string";...<number or string>p
  303.  
  304.  
  305.  
  306.                 FKEY-NEW.BAT
  307.               --------------------------------
  308.              | prompt $e[0;59;"dir a:/p";13p  |
  309.              | prompt $e[0;60;"dir b:/p";13p  |
  310.              | prompt $e[0;61;"basica";13p    |
  311.              | prompt $e[0;62;"copy "p        |
  312.              | prompt $e[0;63;"cls";13p       |
  313.              | prompt $e[0;64;"format b:"p    |
  314.              | prompt $e[0;65;"chkdsk "p      |
  315.              | prompt $e[0;66;"mode co80";13p |
  316.              | prompt $e[0;67;"debug";13p     |
  317.              | prompt $e[0;68;"del "p         |
  318.              | prompt                  |
  319.               --------------------------------
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.               PROMPT $e[0;32;"dir";13p
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.          Table of Keyboard Extended Function Codes
  348.           -----------------------------------------------
  349.          | Key    Normal      <Shift>   <Ctrl>     <Alt> |
  350.          |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  351.          |    F1      59        84          94    104  |
  352.        F     |    F2      60        85          95    105  |
  353.        U     |    F3      61        86          96    106  |
  354.        N  K  |    F4      62        87          97    107  |
  355.        C  E  |    F5      63        88          98    108  |
  356.        T  Y  |    F6      64        89          99    109  |
  357.        I  S  |    F7      65        90          100    110  |
  358.        O     |    F8      66        91          101    111  |
  359.        N     |    F9      67        92          102    112  |
  360.          |    F10      68        93          103    113  |
  361.          |===============================================|
  362.          |    1      49        33           *    120  |
  363.          |    2      50        64          00    121  |
  364.        N     |    3      51        35           *    122  |
  365.        U  K  |    4      52        36           *    123  |
  366.        M  E  |    5      53        37           *    124  |
  367.        B  Y  |    6      54        94          30    125  |
  368.        E  S  |    7      55        38           *    126  |
  369.        R     |    8      56        42           *    127  |
  370.          |    9      57        40           *    128  |
  371.          |    0      48        41           *    129  |
  372.          |===============================================|
  373.          |    A      97        65          01    30   |
  374.          |    B      98        66          02    48   |
  375.          |    C      99        67          03    46   |
  376.          |    D      100        68          04    32   |
  377.          |    E      101        69          05    18   |
  378.          |    F      102        70          06    33   |
  379.          |    G      103        71          07    34   |
  380.          |    H      104        72          08    35   |
  381.          |    I      105        73          09    23   |
  382.        L     |    J      106        74          10    36   |
  383.        E  K  |    K      107        75          11    37   |
  384.        T  E  |    L      108        76          12    38   |
  385.        T  Y  |    M      109        77          13    50   |
  386.        E  S  |    N      110        78          14    49   |
  387.        R     |    O      111        79          15    24   |
  388.          |    P      112        80          16    25   |
  389.          |    Q      113        81          17    16   |
  390.          |    R      114        82          18    19   |
  391.          |    S      115        83          19    31   |
  392.          |    T      116        84          20    20   |
  393.          |    U      117        85          21    22   |
  394.          |    V      118        86          22    47   |
  395.          |    W      119        87          23    17   |
  396.          |    X      120        88          24    45   |
  397.          |    Y      121        89          25    21   |
  398.          |    Z      122        90          26    44   |
  399.           -----------------------------------------------
  400.     If *, code is trapped by keyboard routine and not displayed.
  401.  
  402.