home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MAGAZINE / MISC / MNFEB91.ZIP / ANSITIP < prev    next >
Encoding:
Text File  |  1991-01-26  |  5.1 KB  |  186 lines

  1.  
  2.                                 ANSI.SYS
  3.                                 --------
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. ANSI stands for AMERICAN NATIONAL STANDARDS INSTITUTE. This is the  group who 
  12. sets the standards for all of us. In other words, they see to it that things 
  13. are made in a way that is compatable with others...sot of.
  14.  
  15. DOS is limited as to what it can do when it comes to displaying text on the 
  16. screen. The dialogue between you and DOS is on a line by line basis. ANSI.SYS 
  17. controls what happens on the screen. ANSI.SYS increases DOS's capacity by 
  18. about 5000 bytes, occupying that much more memory. If you are short on 
  19. memory, you may need to remove ANSI.SYS when you run a program that needs 
  20. extra space.
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. SETTING COLOR WITH ANSI:
  32.  
  33.      You are able to set screen colors with ANSI.SYS by the following:
  34.  
  35.              Here are the escape sequences for setting colors on the
  36.      display. Don't forget to preceed and follow them with PROMPT:
  37.  
  38.      $e[0m                          Normal white on black
  39.      $e[1m                          Bold or high intensity
  40.      $e[4m                          Underline (if available)
  41.      $e[5m                          Blinking
  42.      $e[7m                          Reverse Video
  43.      $e[8m                          Concealed (invisible)
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. Codes cont'd...
  51.  
  52.      -------------------------------------------------------
  53.      $e[30m       Black foreground
  54.      $e[31m       Red foreground
  55.      $e[32m       Green foreground
  56.      $e[33m       Yellow foreground
  57.      $e[34m       Blue foreground
  58.      $e[35m       Magenta foreground
  59.      $e[36m       Cyan foreground
  60.      $e[37m       White foreground
  61.      $e[40m       Black background
  62.      $e[41m       Red background
  63.      $e[42m       Green background
  64.      $e[43m       Yellow background
  65.      $e[44m       Blue background
  66.      $e[45m       Magenta background
  67.      $e[46m       Cyan background
  68.      $e[47m       White background
  69.  
  70.      The codes can be combined. All you need to do is enter the numbers
  71.      one after another, but separated by a semicolon [;].
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.      EXAMPLES:
  81.          $e[34;42m  displays blue characters on a green background.
  82.          $e[1;33;41m displays bright (high intensity) yellow characters
  83.                         on a red background.
  84.  
  85.  
  86. SETTING COLORS WITH A BATCH FILE:
  87.  
  88.     At the A prompt type;
  89.                             COPY CON BLUE.BAT
  90.                             PROMPT $e[44;37m
  91.                             PROMPT
  92.  
  93. Note that there was NO ECHO OFF statement in this BATCH FILE! If echo off was 
  94. put in, then the prompt wouldn't be displayed, and the ANSI driver wouldn't 
  95. get the message to change the color.
  96.  
  97.  
  98.  
  99. CUSTOMIZING THE PROMPT:
  100.  
  101. The normal prompt you see when you turn on your PC looks like this: A> You 
  102. can alter it to look like this: A:\>, or this HELLO>
  103.  
  104. The prompt, A:\> , is a custom prompt that not only looks better, it will 
  105. also display what DIRECTORY you are presently in. If you get out of the ROOT 
  106. DIR, and lets say you go into the Directory named 'DOS'
  107.  
  108. The prompt would now display like this:  A:DOS\>
  109.  
  110.  
  111. EXAMPLES:
  112.               prompt $p$g   customizes the prompt like this - A:\>
  113.                             it looks better than, A:> and will also
  114.                             let you know what DIRECTORY you are in.
  115.  
  116.               prompt DATE:$d TIME:$t$_$n$g
  117.                                             Does this:
  118.                          Date: Sat 12-25-19?? Time: 02:35:25:21
  119.                          A:>
  120.  
  121.  
  122.  
  123.  
  124. You can make the prompt say almost anything you want it to. But certian 
  125. characters have special meanings when preceeded by a dollar sign [$]
  126.  
  127.         $t   Displays the time       $d   Displays the date
  128.         $p   Displays the current path
  129.         $v   Displays the MS-DOS version
  130.         $n   Displays the current drive name
  131.  
  132. To avoid confusing MS-DOS, several characters have codes to represent them 
  133. with or should we say when, included in prompting strings:
  134.  
  135.         $$   Displays the [$] character
  136.         $q   Displays an equal [=] sign
  137.         $g   Displays the greater than [>] symbol
  138.         $l   Displays the less than [<] symbol
  139.         $b   Displays the pipe [|] symbol
  140.         $h   Executes a carriage return and line feed
  141.              only kidding, it executes a backspace
  142.         $_   This one executes a carriage return and line feed
  143.         $e   Executes the escape (ASCII 27) code
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. If you are in doubt, or if you make a mistake and what your original prompt 
  153. back, simply type PROMPT, then enter.
  154.  
  155. You can also have the prompt customized to say your name:
  156.  
  157. EXAMPLE: If your name MICRONEWS, do this;
  158.  
  159.                PROMPT MICRONEWS >
  160.  
  161.          Then your prompt will look like this;   MICRONEWS >
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178. We hope that you enjoy working with these hints, as much as we have. As the 
  179. old saying goes, with Computers, there is no end as to what one can do today, 
  180. and as for tomorrow - your imagination is the limit!
  181.  
  182. In the future we will present more material on ANSI.  Like how you can use it 
  183. to program your function keys...and much more.
  184.  
  185. MICRONEWS...
  186.