home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / TelcomTools / ANSI-REFERENCE-MANUAL < prev    next >
Text File  |  2019-04-13  |  34KB  |  687 lines

  1.  
  2.               THEE COMPLEAT ANSI COLOR/ANIMATION/MUSIC MANUAL
  3.                 FOR YOUR AMIGA or IBM-Compatible Computer
  4. [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
  5.     Before we get to specific ways to send control codes to the ANSI/Amigados
  6. driver, you must first know what those codes mean.  For the function keys the
  7. codes are listed on the chart below.
  8. ==============================================================================
  9.        FUNCTION KEY REASSIGNMENT WITH ANSI (Does NOT work on AMIGA!)
  10. ------------------------------------------------------------------------------
  11.    Each function key is assigned an "extended function code" which DOS will use
  12. to recognize that a function key has been pressed and in what shifted mode, if
  13. any.  Each number is expressed as a 0 followed by a semi-colon, then the
  14. number from the chart below.
  15.  
  16.                 KEY     NORMAL  SHIFT   CONTROL  ALT
  17.                 F1      59      84      94      104
  18.                 F2      60      85      95      105
  19.                 F3      61      86      96      106
  20.                 F4      62      87      97      107
  21.                 F5      63      88      98      108
  22.                 F6      64      89      99      109
  23.                 F7      65      90      100     110
  24.                 F8      66      91      101     111
  25.                 F9      67      92      102     112
  26.                 F10     68      93      103     113
  27.  
  28. Accordingly, the way to designate the F5 key would be 0;63 while the F10 key
  29. would be designated by 0;68 or 0;113 if shifted with the ALT key.
  30. ============================================================================
  31.           KEYBOARD REASSIGNMENT WITH ANSI (Does not work on AMIGA!)
  32. ----------------------------------------------------------------------------
  33. If you examine the DOS Technical Reference Manual (not the Technical Manual
  34. for PC hardware), you will find a section on SCREEN/KEYS.  This section was
  35. contained in the DOS 2.0 documentation, but IBM removed it in later editions.
  36. Here is a summary of its contents relative to keyboard redefinition.
  37.  
  38. To change one key to have the meaning of another, enter:
  39.  
  40.                                  ESC [#;#p
  41.  
  42. where the first # is the ASCII value of the key being changed and the second #
  43. is the ASCII value of the new definition.  For example, "A" has the ASCII
  44. value of 65 and "Q" has the value of 81.  So:
  45.  
  46.                                  ESC [65;81p
  47.  
  48. will result in "A" being redefined as "Q."  It is also possible to redefine a
  49. key to have the meaning of a string of characters.  This is done by enclosing
  50. the string in quotes.  So:
  51.  
  52.                                  ESC [65;"Hi there"p
  53.  
  54. would change the "A" key to have the meaning of "Hi there."  If the first
  55. value for the first # is a 0 however, DOS knows that what is being changed is
  56. not an ASCII value but the meaning of an extended function code.  So if you
  57. were to enter:
  58.  
  59.                                  ESC [0;68;"Hi there"p
  60.  
  61. DOS would know to change the meaning of the function key (in this case F10) to
  62. the sting enclosed in quotes.  This is the key to redefining your function
  63. keys to perform much used commands: like DIR, CHKDSK, COPY *.* B: etc. or to
  64. load programs from disk.
  65.  
  66. There is a final trick here.  If you end the escape command sequence with the
  67. characters ";13p" instead of just "p" the command will self-execute, just as
  68. if you pressed the [enter] key.
  69.  
  70. The IBM documentation tells the user to preface each command by an ESC
  71. command, and I have represented this in the above paragraphs by writing the
  72. characters "ESC." at the start of each control code sequence mentioned.  Most
  73. users assume that this means to press the ESC key on the keyboard when
  74. entering the commands.  Not so.  To get the Escape Sequence to the ANSI driver
  75. you must enter it using a prompt command or write a .COM file.  For example to
  76. configure the F1 key (extended function code 59) to have the meaning in DOS of
  77. "autoexec" with an [enter] command at the end of it you cannot type:
  78.  
  79.                                 ESC [0;59;"autoexec";13p
  80.  
  81. as the ESC will not be recognized by DOS as an escape sequence.  What DOS will
  82. recognize as an escape sequence is the characters "$e" although this surely
  83. looks strange at first.  Users familiar with the PROMPT command will notice
  84. that the "$" character is what the PROMPT command uses as an escape sequence,
  85. and that is precisely how we will get the redefinition to be recognized by
  86. DOS.  If you enter the following command:
  87.  
  88.  
  89.                                 PROMPT $e[0;59;"autoexec";13p
  90.  
  91. you will see that it works perfectly.  You now have the secret to redefining
  92. the function keys in DOS.  Simply write and run a batch file with a list of
  93. PROMPT commands and you will have done it.  One precaution, ECHO must be ON,
  94. otherwise DOS will suppress the PROMPT command and the escape sequences will
  95. not get through.
  96.  
  97. As an example, let's create a batch file called KEYON.BAT that will set F1 as
  98. EDITOR [enter], F2 as PC-FILE [enter], F3 as PC-CALC [enter], F4 as PC-GRAPH
  99. [enter], F5 as PC-TALK [enter], F6 as PC-WRITE [enter], F7 as BASICA [enter],
  100. F8 as DIR without the [enter], F9 to run a batch file called MENUOFF.BAT
  101. [enter] and F10 to run a batch file called MENUON.BAT [enter].  It would be as
  102. follows:
  103.  
  104.                 echo on
  105.                 PROMPT $e[0;59;"EDITOR";13p
  106.                 PROMPT $e[0;60;"PC-FILE";13p
  107.                 PROMPT $e[0;61;"PC-CALC";13p
  108.                 PROMPT $e[0;62;"PC-GRAPH";13p
  109.                 PROMPT $e[0;63;"PC-TALK";13p
  110.                 PROMPT $e[0;64;"PC-WRITE";13p
  111.                 PROMPT $e[0;65;"BASICA";13p
  112.                 PROMPT $e[0;66;"DIR"p
  113.                 PROMPT $e[0;67;"MENUOFF";13p
  114.                 PROMPT $e[0;68;"MENUON";13p
  115.                 prompt
  116.                 cls
  117.  
  118. You would also want to create another file called KEYOFF.BAT which resets the
  119. function key definitions to DOS normal.  The format would be:
  120.  
  121.                 echo on
  122.                 PROMPT $e[0;59;0;59p
  123.                 PROMPT $e[0;60;0;60p
  124.                 PROMPT $e[0;61;0;61p
  125.                 PROMPT $e[0;62;0;62p
  126.                 PROMPT $e[0;63;0;63p
  127.                 PROMPT $e[0;64;0;64p
  128.                 PROMPT $e[0;65;0;65p
  129.                 PROMPT $e[0;66;0;66p
  130.                 PROMPT $e[0;67;0;67p
  131.                 PROMPT $e[0;68;0;68p
  132.                 prompt
  133.                 cls
  134.  
  135. I should mention that the purpose of the final blank PROMPT command in each of
  136. these batch files is to reset the DOS prompt to A> or whatever your default
  137. prompt is.  It serves no redefinition purpose, but does keep the screen
  138. looking clean.
  139. ============================================================================
  140.                     CURSOR POSITIONING / MOVEMENT
  141. ----------------------------------------------------------------------------
  142.      To move the cursor to a specified position: ESC [#;#h where the first #
  143.      is the desired line number and the second the desire column.
  144.  
  145.      To move the cursor up without changing columns: ESC [#a where # specifies
  146.      the number of lines moved.
  147.  
  148.      To move the cursor to a specified horizontal and vertical position: ESC
  149.      [#;#f where # means first the line number and secondly the column number.
  150.  
  151.      To get a cursor position report: ESC [#;#r where the first # specifies
  152.      the current line and the second # specifies the current column
  153.  
  154.      To move the cursor down: ESC [#b where # specifies the number of lines
  155.      moved down.
  156.  
  157.      To move the cursor forward: ESC [#C where # specifies the number of
  158.      columns moved.
  159.  
  160.      To move the cursor backward: ESC [#d where # specifies the number of
  161.      columns moved.
  162.  
  163.      To save the cursor position: ESC [s and to restore it: ESC [u.
  164. =========================================================================
  165.                   ERASING SCREEN (CLS) AND ERASING A LINE
  166. -------------------------------------------------------------------------
  167.      To do a CLS (erase screen move cursor to home position): ESC [2j
  168.  
  169.      To erase from cursor to end of line: ESC [k
  170. =============================================================================
  171.            DEVICE STATUS REPORT (Does NOT appear to work on AMIGA)
  172. -----------------------------------------------------------------------------
  173.      To get a device status report: ESC [6n
  174. =============================================================================
  175.                           ANSI COLOR GRAPHICS
  176. -----------------------------------------------------------------------------
  177.      To set the color/graphics attributes, enter ESC [#;#m where the first #
  178.      is the desired foreground color and the second is the desired background
  179.      color.  Select colors from the list below:
  180.  
  181. (NOTE: Following amiga colors were with preferences settings of blue, black,      
  182.       orange and white default colors.)
  183. ---------------------------------------------------------------------------
  184.    CODE  US ANSI STANDARDS RESULT         CODE  AMIGA ANSI RESULT
  185. =======================================================================
  186.      30  black foreground-----------------  30  Blue foreground (text)
  187.      31  red foreground-------------------  31  White foreground (text)
  188.      32  green foreground----------------   32  Black foreground (text)
  189.      33  yellow foreground---------------   33  Orange foreground (text)
  190.      34  blue foreground-----------------   34  Blue foreground (text)
  191.      35  magenta foreground--------------   35  White Forground (text)
  192.      36  cyan foreground-----------------   36  Black foreground (text)
  193.      37  white foreground----------------   37  Orange foreground (text)
  194.      38  Unknown-------------------------   38  Unknown
  195.      39  Unknown-------------------------   39  Unknown
  196. ----------------------------------------------------------------------------
  197.      40  black background----------------   40  Blue background
  198.      41  red background------------------   41  White Background
  199.      42  green background----------------   42  Black background
  200.      43  yellow background---------------   43  Orange background
  201.      44  blue background-----------------   44  Blue background
  202.      45  magenta background--------------   45  White background
  203.      46  cyan background-----------------   46  Black Background
  204.      47  white background----------------   47  Orange background
  205.      48  Unknown-------------------------   48  Unknown
  206.      49  Unknown-------------------------   49  Unknown
  207. NOTE: Please note that for both the foreground and background sections, the
  208. colors repeat after each four codes; ie: Blue text = 30 or 34;
  209. Blue background= 40 or 44..  Also, as long as you know the escape code for
  210. the foreground color, the same color for background will be 10 numbers higher.
  211. This is true for both the IBM and Amiga.
  212. =============================================================================               
  213.                    -- ADDITIONAL ANSI ATTRIBUTES --
  214. -----------------------------------------------------------------------------
  215.      To set additional attributes enter: ESC [#m where # is the number of the
  216.      desired attribute.  Select attributes from the list below:
  217.  
  218.      0  all attributes off (defaults to original Preferences settings)
  219.  
  220.      IBM ESCAPE CODE                          AMIGA RESULT
  221. ---------------------------------------------------------------
  222.      0  All ansi attributes off            0  All ansi attributes off
  223.      1  bold on                            1  BOLD ON
  224.      2  Unknown                            2  Turns text black
  225.      3  Italics on                         3  Italics on
  226.      4  underscore                         4  underscore
  227.      5  blink                              5  does NOT work on amiga
  228.      6  Unknown                            6  Unknown
  229.      7  reverse video                      7  Reverse video
  230.      8  invisible                          8  Invisible
  231. ---------------------------------------------------------------------------
  232.                IBM EXAMPLES FOR USE OF ANSI ATTRIBUTE CODES
  233. To give an example of what can be done with these additional codes, a batch
  234. file called MENUOFF.BAT containing only the line:
  235.  
  236.                         PROMPT $e[2J$e[30;40m$h
  237.  
  238. would blank a color display completely.  It does a CLS, sets the display to a
  239. black foreground and background and the with the "$h" performs a backspace to
  240. erase the blinking cursor (the "$h command is documented in the DOS manual
  241. under PROMPT).
  242.  Another batch file called MENUON.BAT containing the lines:
  243.  
  244.       PROMPT $e[0m
  245.       prompt
  246.       cls
  247.  
  248. Would reset a color display to restore the screen after MENUOFF.BAT had been
  249. run.
  250. =========================================================================
  251.      USING DEBUG TO LOAD THE ANSI DRIVER  (APPLICABLE ONLY TO IBM)
  252. -------------------------------------------------------------------------
  253. While there is no reason why we could not continue to configure our function
  254. keys by batch files consisting of lists of PROMPT commands, this is a clumsy
  255. way to proceed.  It is easier to use the DEBUG utility supplied with DOS to
  256. create a .COM file that will do the job for us quickly and directly, without
  257. sending any input to screen.
  258.  
  259. Place a formatted DOS disk containing the DEBUG utility in the default drive,
  260. and follow the script below.  As you do so hexadecimal numbers will appear on
  261. the left hand side of your screen.  These numbers will vary depending on the
  262. configuration of your system.  For our purposes here I will represent the
  263. numbers in the form xxxx:nnnn.  What you will see on your screen will be
  264. different.
  265.  
  266. A>DEBUG [enter]
  267. -A 100 [enter]
  268. MOV AH,9 [enter]
  269. MOV DX,109 [enter]
  270. INT 21 [enter]
  271. INT 20 [enter]
  272. xxxx:nnnn DB 1B'[0;59;"EDITOR";13p' [enter]
  273. xxxx:nnnn DB 1B'[0;60;"PC-FILE";13p' [enter]
  274. xxxx:nnnn DB 1B'[0;61;"PC-CALC";13p' [enter]
  275. xxxx:nnnn DB 1B'[0;62;"PC-GRAPH";13p' [enter]
  276. xxxx:nnnn DB 1B'[0;63;"PC-TALK";13p' [enter]
  277. xxxx:nnnn DB 1B'[0;64;"PC-WRITE";13p' [enter]
  278. xxxx:nnnn DB 1B'[0;65;"BASICA";13p' [enter]
  279. xxxx:nnnn DB 1B'[0;66;"DIR"p' [enter]
  280. xxxx:nnnn DB 1B'[0;67;"MENUOFF";13p' [enter]
  281. xxxx:nnnn DB 1B'[0;68;"MENUON";13p' [enter]
  282. xxxx:nnnn DB 1B '$' [enter]
  283.  
  284.      As soon as you have entered the previous line, your computer will respond
  285.      with a number in the form of xxxx:nnnn.  Copy down the portion of the
  286.      number that is being represented here as "nnnn" as you will need it
  287.      later.  Once you have copied the number down, press [enter]
  288.  
  289. xxxx:nnnn [enter]
  290. -N KEYON.COM [enter]
  291. -R BX [enter]
  292.  
  293.      When you have entered the command above, your computer will respond with
  294.      the following line and a colon as a prompt.  At this prompt enter 0 and
  295.      press [enter].
  296.  
  297. BX:0000
  298. :0 [enter]
  299. -R CX [enter]
  300.  
  301.      When you enter the R CX command above, the computer will respond with the
  302.      following line and a colon as a prompt.  At this prompt enter the number,
  303.      "nnnn" you copied down above and press [enter].
  304.  
  305. CX 0000
  306. :nnnn [enter]
  307. -W [enter]
  308.  
  309.      The computer will respond with the following.
  310.  
  311. WRITING nnnn bytes
  312. -Q [enter]
  313.  
  314. As soon as you enter the Q command (for Quit) you will be back at the DOS
  315. prompt, and there will be a new file on disk called KEYON.COM.  Simply type it
  316. at the DOS prompt and your function keys will be configured.  It is a good
  317. idea to use this same procedure to write another .COM file called KEYOFF.COM
  318. which will restore the keys to their native DOS definitions.  The procedure
  319. for this is the same as the above, except that the definition section should
  320. be:
  321.  
  322. xxxx:nnnn DB 1B'[0;59;0;59p' [enter]
  323. xxxx:nnnn DB 1B'[0;60;0;60p' [enter]
  324. xxxx:nnnn DB 1B'[0;61;0;61p' [enter]
  325. xxxx:nnnn DB 1B'[0;62;0;62p' [enter]
  326. xxxx:nnnn DB 1B'[0;63;0;63p' [enter]
  327. xxxx:nnnn DB 1B'[0;64;0;64p' [enter]
  328. xxxx:nnnn DB 1B'[0;65;0;65p' [enter]
  329. xxxx:nnnn DB 1B'[0;66;0;66p' [enter]
  330. xxxx:nnnn DB 1B'[0;67;0;67p' [enter]
  331. xxxx:nnnn DB 1B'[0;68;0;68p' [enter]
  332. xxxx:nnnn DB 1B '$' [enter]
  333.  
  334. If you find that KEYON.COM doesn't work correctly, reboot the machine to clear
  335. the definitions and try again.  The most common mistakes are typing errors (I
  336. often enter a colon when I wanted a semi-colon).  Another source of difficulty
  337. will arise if you have another file on disk to start with called KEYON.COM or
  338. KEYOFF.COM.  DEBUG bypasses the normal file allocation of DOS and writes
  339. directly to the disk.  If you have another file on disk with the same name,
  340. DEBUG will overwrite it, but unless the other file was exactly the same size
  341. as the new one or smaller, there may be a piece of the old file left over
  342. attached to the end of the new one.  As a precaution, always erase old
  343. versions of the .COM files, or better yet give each one a unique name and
  344. rename it later using the DOS Rename command.
  345. =============================================================================
  346.               USING ANSI ON AMIGA WITH BBS-PC! SOFTWARE
  347.  
  348. -----------------------------------------------------------------------------
  349.       This article is from the November, 1986 issue (#2) of AMIGAZINE!
  350.  
  351.  
  352.    THIS ARTICLE IS COPYRIGHT (C) 1986 DIGITAL PUBLISHING, AND BRIAN JEAN.
  353.    ALL RIGHTS RESERVED.  DISTRIBUTION RIGHTS GRANTED TO GENIE AND DELPHI.
  354.  
  355.  
  356.                 Creating Custom Color Menus For BBS-PC!
  357.                      (Using ANSI Escape Sequences)
  358.  
  359.                             By Brian Jean
  360.  
  361.  
  362. Running a BBS (Bulletin  Board  Service)  can  be  a lot of fun, and a lot of
  363. work.  SYSOPs  (SYStem  OPerators)  are  forever  trying  to  make  their BBS
  364. look different from the BBS  next  door,  even though they may be running the
  365. same software. ANSI escape sequences are one such way of making your BBS look
  366. different from all the others.
  367.  
  368. In the example I am about to give,  BBS-PC!  software is being used. Although
  369. the syntax may differ a bit, the  concept  should  work the same for those of
  370. you running a BBS on other than BBS-PC!.
  371.  
  372. BBS-PC!  allows  the  SYSOP  to  customize  his  menus.  It  is  through this
  373. customization process that we are allowed to insert our ANSI escape sequences
  374. to add color and cursor control to our menus. Before we can get into the meat
  375. of things, you must first  understand  how  BBS-PC!  allows you to add "ASCII
  376. CHARACTER GRAPHICS" to your menus.  Although  we  will not actually be adding
  377. ASCII CHARACTER GRAPHICS,  the  technique  we  will be using is the same. The
  378. syntax is simple.  Within your  menu,  place  a  backslash  (\) followed by a
  379. number, which is the ASCII value  for  the  character  you want inserted into
  380. your menu.  For example, let's say you  want  to actually add a backslash  to
  381. your menu. You can not simply type in a backslash because BBS-PC! will see it
  382. and view it as a special character  telling  the  menu compiler that an ASCII
  383. value will follow.  Therefore, the syntax would be:
  384.  
  385.                                    \92
  386.                                    | |
  387.    Tells the menu compiler an -----+ +----- The ASCII value
  388.    ASCII value will follow                  for a backslash (\)
  389.  
  390. That's it. Real simple. So, if you wanted part of your menu to look like
  391. this:
  392.  
  393.                     +---------------------------------+
  394.                     | R:Read Messages    D:Down Loads |
  395.                     |                                 |
  396.                     | \:Page SYSOP       G:Good-bye   |
  397.                     |                                 |
  398.  
  399. The actual syntax in your menu (prior to compiling) would be:
  400.  
  401.                     +---------------------------------+
  402.                     | R:Read Messages    D:Down Loads |
  403.                     |                                 |
  404.                     | \92:Page SYSOP       G:Good-bye |
  405.                     |                                 |
  406.  
  407. Now that you have the general idea, let's get to work on a real menu.
  408.  
  409. Adding the color and cursor  control  is  easy.  We'll be using the backslash
  410. followed by an ANSI escape sequence. The two sequences we will be using are:
  411.  
  412.                          ESC[xM and ESC[r,cH
  413.  
  414.                         Where ESC = ESCape (ASCII 27)
  415.                                 [ = "["
  416.                                 x = Color Code
  417.                                 M = "M"
  418.                                 r = Row #
  419.                                 c = Column #
  420.                                 H = "H"
  421.  
  422. The first sequence adds color and the second places the cursor at a specified
  423. ROW and COLUMN.
  424.  
  425. The following is a modified version of the  actual Main Menu as I have it set
  426. up on  my  BBS.  Because  of  the  screen  width  limitation  here  for  this
  427. demonstartion, some of the menu  has been extracted to make room for the most
  428. important part.  The very first  part of  each line, which reads TITLE =, has
  429. been eliminated, along with some of the  filler characters such as several of
  430. the "-" characters in the  border.   See  your  BBS-PC! manual for the proper
  431. syntax of menus as required by your menu compiler.
  432.  
  433. menu = BBS-0.MEN, "\13\13\13Main Func (? for menu): ", 1, 2
  434. \12 \13 \13 \27[33m+-------------------------------------------MAIN MENU-+"
  435. |                    Message Commands                     |"
  436. |                    ----------------                     |"
  437. |    Scan Message        E-Mail          Read Messages    |"
  438. |    Leave Message       Price List      Comment to SYSOPm|"
  439. |                                                         |"
  440. |                    System Commands                      |"
  441. |                    ---------------                      |"
  442. |    Good-bye            Caller log      Time on System   |"
  443. |    Section mask        Expert          Change Options   |"
  444. |    Your Stats.         40 Column       Page SYSOP       |"
  445. |    Bulletins/Help      Display         File U/Dload     |"
  446. | \27[0m              !: Turn Off ANSI                    |"
  447. +---------------------------------------------------------+ \27[0m"
  448. title = "\27[0m \27[6;12H S: \27[6;32H E: \27[6;48H R:"
  449. title = "\27[7;12H L: \27[7;32H P: \27[7;48H C:"
  450. title = "\27[11;12H G: \27[11;32H U: \27[11;48H T:"
  451. title = "\27[12;12H M: \27[12;32H X: \27[12;48H O:"
  452. title = "\27[3;30H \7 THE AMIGA PROJECT! "
  453. title = "\27[13;12H Y: \27[13;32H +: \27[13;48H /:"
  454. title = "\27[14;12H B: \27[14;48H F:"
  455.  
  456.  
  457. This is how the menu looks to the user when he or she calls in:
  458.  
  459.  
  460. +------------------ THE AMIGA PROJECT! ---------MAIN MENU-+
  461. |                    Message Commands                     |
  462. |                    ----------------                     |
  463. | S: Scan Message     E: E-Mail       R: Read Messages    |
  464. | L: Leave Message    P: Price List   C: Comment to SYSOP |
  465. |                                                         |
  466. |                    System Commands                      |
  467. |                    ---------------                      |
  468. | G: Good-bye         U: Caller log   T: Time on System   |
  469. | S: Section mask     X: Expert       O: Change Options   |
  470. | Y: Your Stats.      +: 40 Column    /: Page SYSOP       |
  471. | B: Bulletins/Help      Display      F: File U/Dload     |
  472. |                     !: Turn Off ANSI                    |
  473. +---------------------------------------------------------+
  474.  
  475.  
  476. Main Func (? for menu):
  477.  
  478.  
  479. Now for a line by line description of what we just did. 
  480.  
  481. menu = BBS-0.MEN, "\13\13\13Main Func (? for menu): ", 1, 2
  482.  
  483. The very first line defines the  name  of  the  menu and the prompt used. The
  484. only thing new here from the standard  menu  is the three "\13"'s. This sends
  485. three ASCII 13's (RETURN's) to the  user.  This is VERY important in the menu
  486. as I have it set up. Without it, your  menu  prompt  will pop up somewhere in
  487. the middle of the screen.
  488.  
  489. \12 \13 \13 \27[33m+-------------------------------------------MAIN MENU-+"
  490.  
  491. The next line is where the fun begins. the  "\12" sends an ASCII 12, which is
  492. more commonly know as a screen clear.  This  will clear your user's screen to
  493. ensure proper menu positioning.  If  the  system  your user is using does not
  494. recognize ASCII 12 as a screen clear, then this menu will look like a mess to
  495. him. I'll explain later what to do if this  happens. After the \12, comes two\13's. This again, sends two more RETURN's  to the user. This just places the
  496. menu two lines down from the top  of  the  menu.  \27[33m  is the first color
  497. sequence. This turns the character  color  to  RED. Everything following will
  498. show up on the callers screen as color. I said 33 is RED, but RED is not what
  499. is always seen. The actual color seen will depend on what the user has his or
  500. her colors set to in preferences. The SYSOP will see YELLOW in his menu. This
  501. is due to the color definitions  used  in  BBS-PC!.  I haven't found a way to
  502. change this.
  503.  
  504. The remainder of the menu is then sent in RED, until it comes to this line.
  505.  
  506. | \27[0m              !: Turn Off ANSI                    |"
  507.  
  508. The \27[0m turns off ALL ANSI escape sequences which are now active. In other
  509. words, the character  color  received  by the caller will return to white, or
  510. what ever color that user has  set  his  or  her white to in preferences. The
  511. reason I did this in this line,  is  because  my  default  menu uses the ANSI
  512. sequences. A user who is  calling  with  a  terminal that can not accept ANSI
  513. sequences will see a mess for a menu  the  first  time through. The comand to
  514. turn off the ANSI is then clearly visible.
  515.  
  516. As I am sure you have noticed, what  we  have  actually done here, is display
  517. the menu descriptions, but not the actual  commands.  A user sees a menu that
  518. says SCAN MESSAGES E-MAIL PAGE SYSOP etc  ..., but the user doesn't know what
  519. key to press to activate that command. Here's  where the real fun begins. The
  520. following sequences cause the cursor to jump around the screen filling in the
  521. actual commands. This can make for a real interesting menu.
  522.  
  523. Here's the sequences that actually do that.
  524.  
  525. title = "\27[0m \27[6;3H S: \27[6;23H E: \27[6;39H R:"
  526.  
  527. The first sequence (\27[0m) turns off all ANSI as it did before, this causes 
  528. the actual commands to pop onto the screen in a color different from the rest
  529. of the menu. The next sequence  \27[6;3H S: sends the cursor to row 6, column
  530. 3 and prints S: the command for Scan Messages. \27[6;23H E:  sends the cursor
  531. to row 6, column 23 and prints E:, then command for E-Mail.
  532.  
  533. As you can now see, we are filling in the  menu. You should have little or no
  534. trouble figuring out what the remainder  of the sequences do.  They all go to
  535. a specified row and column and print a command.
  536.  
  537. title = "\27[3;21H \7 THE AMIGA PROJECT! "
  538.  
  539. This one sends the cursor to row  3, column  21  and sends an ASCII 7, better
  540. known as CONTROL-G or a  bell,  followed  by  the  name  of my BBS, THE AMIGA
  541. PROJECT!
  542.  
  543. That's it. That's all there is to it. 
  544.  
  545. The way I have my BBS set up, when  a  user  selects  the ! command (Turn OFF
  546. ANSI), it sends the user to another menu  set which does not utilize the ANSI
  547. escape sequences. I also have two  menus  set up for the AMIGA in my terminal
  548. definitions. One is called  AMIGA!  and  the  other  is called AMIGA! *ANSI*.
  549. Obviously, one uses the ANSI escape  sequences  and  the other does not. This
  550. allows each user to decide for himself if  he does or does not want the fancy
  551. color and screen display.
  552.  
  553. There are a lot more ANSI sequences available. Get you hands on an ANSI table
  554. and see what variations you can come  up  with  for menu display. A few quick
  555. examples of more ANSI sequences are:
  556.  
  557.           ESC[nC   where n = a number. The cursor is then moved right that
  558.                    number of lines without changing rows.
  559.  
  560.           ESC[nD   where n = a number. The cursor is then moved left that
  561.                    number of lines without changing rows.
  562.  
  563.           ESC[K    where K = the letter "K". Erases the curent line from the
  564.                    cursor position to the end.
  565.  
  566. Most of the popular public domain  terminal  programs  accept the ANSI escape
  567. sequences.  Some, such as OnLine!,  allow  the user to choose between several
  568. terminal types, one of which is ANSI.  The  user  MUST  be set to ANSI or the
  569. screen will be a mess on his end.
  570. If you want to take a quick look  at  what  this  demonstration  really looks
  571. like, feel free to set your terminal to ANSI, and give my BBS a call. You can
  572. reach us at 300/1200 baud, 24 hrs, (805) 834-9383.
  573. =============================================================================
  574.                 RBBS-PC SYSOP ANSI.SYS COLOR HELP
  575.        Adding Ansi Color and MUSIC to your WELCOMEG File
  576.         NOTE: MUSIC codes do not appear to work on AMIGA
  577. ------------------------------------------------------------------------------
  578.    In order for a Caller to receive color and music from an RBBS, the
  579. Caller needs to have the statement:  DEVICE=ANSI.SYS in the CONFIG.SYS
  580. file (and reboot system), or PC-TALK with ANSI.MRG applied (merged),
  581. plus DOS 2.x operating system.
  582.    The SYSOP needs to run RBBS-PC version CPC12.2A (or later), and have
  583. the appropriate Escape codes in the WELCOMEG file.  Please read chapter
  584. 13 of the DOS 2.0 Manual for a very brief summary of escape codes.
  585.  
  586.    The Escape codes will allow you to issue special character sequences
  587. to the Caller which will permit screen formatting, color graphics and
  588. music to be executed for the Caller.
  589.  
  590.    The Escape Code is ASCII 027 and Hex 1B and cannot be issued within
  591. EDLIN or DOS.  The normal procedure is to use a dummy variable to represent
  592. the Esc code and then go into DEBUG and replace the dummy variable with
  593. Hex 1B.  However, Volkswriter, Volkswriter Delux and PC-WRITE (freeware)
  594. issue a true ESC code when the ESC key is depressed.  If you have access
  595. to one of these word processing programs, you can set up your graphics
  596. first, then go into the word processing program and insert the ESC codes
  597. to enable color graphics and music.  However, appended to this help file
  598. is a program known as SGR.TXT (or CLR.TXT) which contains true ESC codes
  599. which can be copied over to your WELCOMEG file using the Transfer function
  600. of EDLIN (if last line in your file is 99, then issue:  100TANSICLR.HLP
  601. and you will append this file to the end of your WELCOMEG file.  Then
  602. copy and delete as appropriate to move the ESC codes to where they are
  603. needed.
  604.  
  605. BEGINNING OF YOUR FILE:
  606.  
  607.    All ANSI color/music/format statements have the format:
  608.  
  609.       nn;nn;x  where nn is a valid number and x is an alpha operand.
  610.  
  611.         set attributes off (0) bold on (1) white f/g (37)
  612.                      and blue background (44)
  613.    At the beginning of your file you will want a format command to 
  614. start the text in the middle of the screen so the Caller will have
  615. time to read it as it scrolls upward.
  616.    1;f  The first 0 turns off any attributes the caller has set
  617.                   on his/her own system before calling your RBBS.  The
  618.                   second statement starts text at line 17 column 1 and the
  619.                   "f" operand is for format.
  620.   Your second line should specify the color, with bold (highlight) on or
  621. off and blinking (05) on or off:
  622. ;37;44;M   "1" turns bold on; "37" white foreground; "44" blue
  623.                  background; "m" designates Set Graphics Rendition mode
  624.    Now, if you do nothing else, the callers screen will start on the
  625. 17th line in the first column, and will stay bold white letters on a
  626. blue background.  The text/graphics will scroll normally from the 17th
  627. line and the color will not change until the caller signs off.
  628.       j   inserted at the end of the first 23 lines of graphics
  629.                 on line 24, will return to white on black and erase the
  630.                 screen and place the curser on the home position.
  631.         inserted on line 25 will turn green foreground and black
  632.                 (default) background on, until the next ESC code is read.
  633.                  bold is now off and blinking is off (due to the 0; cmd)
  634.         turns bold on and green f/g with (default) black b/g.
  635.    You can insert ESC codes inside graphic frames to change the color
  636. of the lettering inside the frame, leaving the frame a different color:
  637.   Do not forget to add ^[00m as the last attribut so as to return the
  638.   callers screen to his own default settings.
  639.  
  640.    Please notice that the ESC codes are INSERTED and place the vertical
  641. bars out of alignment, even though they will display correctly (try
  642. TYPE ANSICLR.HLP to see display if you have ANSI.SYS in your CONFIG.SYS).
  643. For this reason, we recommend constructing your graphics first, and then
  644. insert the ESC codes using PC-WRITE or Volkswriter, or some other personal
  645. editor like EDLIN.
  646.  
  647. FORMATTING
  648.  
  649.    The ESC[[xx;yy;F command will format the screen where xx is column number
  650. and yy is line number.  You can either start the screen at column x and
  651. line y and then let it scroll normally, or you can continue to format the
  652. screen, by subsequent ESC[[xx;yy;F commands telling the cursor where to
  653. start printing the line of text which follows the format statement.  
  654. After the last format statement, the text will continue to scroll normally.
  655. Just remember if you continue formatting you will have less control over
  656. where the page breaks will fall, but trial and error will get you through.
  657.  
  658. MUSIC
  659.  
  660.    Music works just like the BASIC PLAY statement, except the Music
  661. Background statement will not work in RBBS-PC.  The format is:
  662.  
  663. MFO..............................................
  664.  
  665.    will play music in foreground (MFO is letter O not zero).  The MFO
  666. statement is required only for the first line of each song, and each
  667. line of the song can terminate with the ESC N.  The letter O in MFO
  668. sets the current octave (from 0 to 6) for the following notes.  Instead
  669. of MFO you can use MSO for staccato or MST150 for Staccato Tempo 150
  670. (tempo default is 120 quarter notes in a minute).  You may want to
  671. create your music using BLUESBOX.BAS and then append the resulting
  672. music and copy it to the correct line number and insert the ESC codes
  673. required.
  674.  
  675. CLOSING YOUR FILE
  676.  
  677. You should close your file with an ESC[[0 to turn off the colors,
  678. highlighting and flashing or it will continue on the Callers screen
  679. throughout the session.  
  680.    If you wish to leave color on, remember Callers will be using monochrome
  681. screens and some colors are almost unreadable on monochrome, which
  682. defeats the purpose of having a Bulletin Board System.  We recommend
  683. leaving green on black, yellow on black or white on blue: (For IBM systems)
  684.   Bold on; yellow f/g; black b/g
  685.   Bold on; green f/g; black b/g
  686.   Bold on; white f/g; blue b/g
  687.