ANSI-TI.DOC  ·  DOC  ·  3.3 KB  ·  1987-01-21  ·  from CompuLink-User-Group_Magazette_Feb-1987
                               The ANSI driver
                                Michael Sage

    The  ANSI  driver  is  the  (so called) "standard" terminal driver for
    microcomputers.  Standard,  because  it  is  issued  by  the  American
    National  Standards  Institute (ANSI) and should drive any terminal in
    any  application;   so  called,  because  it  is   rarely   used   for
    applications  programming.   It is slow and is only a minimal terminal
    driver.  Despite it's problems and limitations it can be a useful tool
    in  making  our  life easier;  after all isn't that what a computer is
    for?  At this point you may be wondering what or where the ANSI driver
    is.   Never  fear, TI users, it is right there in DOS.  Unlike our IBM
    brothers we have the ANSI driver as a part of DOS.  We need do nothing
    save use it.  Now, what are we going to do with this invisible driver?
    Well, we could do something simple, like this:

    ex.  ^[[33m PRINT THIS MESSAGE

    This will  print  the  message  in  yellow  instead  of  white  (on  a
    monochrome  screen,  the  intensity  will be different).  Or we may do
    something a bit more complex, such as:

    ex.  ^[[2J^[[10;1H^[[4;5;35m PRINT THIS MESSAGE ^[[24;1H^[[0;1m

    This will clear the screen  and  display  the  message  in  underlined
    blinking  magenta, on line 10 of the screen and place your prompt (A>)
    on line 24.  The "^[[" ( ESC [ ) in both  of  these  statements  is  a
    signal to the ANSI driver telling it that what fol- lows is a command.
    The ANSI driver then intercepts the following text and processes it as
    a  command.   To issue commands to the ANSI driver, you must first put
    them in a file.  You can  do  this  with  EDLIN  (remember,  the  "^["
    represents ESC, in EDLIN you can press ESC key for this purpose).  The
    file maybe executed (ie.  a batch file) or typed to the  screen  using
    the  DOSTYPE  command.   Changing  screen  attributes  is not the only
    function of the ANSI driver.  It  has  been  called  "the  poor  man's
    ProKey".   The  driver  allows  you to redefine the keyboard.  You can
    configure the function keys or redefine what  character  a  key  sends
    when  pressed.  You may say to yourself at this point, "so what, I can
    configure my function keys with CONFIG".  So you can, but you can  not
    assign  as  many characters to your function keys in config as you can
    with ANSI.  Also, you can  not  configure  the  control  or  alternate
    function  keys  with CONFIG, you can with the ANSI driver.  To review;
    the ANSI driver gives you much greater control over your keyboard than
    you currently have without it.  You can position the cursor, erase all
    or part of the  screen,  set/change  text  color  and  attributes  and
    customize your keyboard.

    examples:

    ^[[10;15H text print text at line 10, column 15.

    ^[[2J clear screen and home the cursor.

    ^[[36m text print text in cyan.

    ^[[32;7m text print text in red with reverse video.

    ^[[96;42p define unshifted ~/` key to be *


    ^[[0;109;"CHKDSK";  13p configure alt F6 to be CHKDSK<RETURN>^L

    For  further  information  about  the ANSI driver, refer to Chapter 9,
    Extended Screen and Keyboard Control, of your DOS manual.