home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / ansicd.zip / readme < prev   
Text File  |  1994-12-30  |  4KB  |  120 lines

  1.  
  2. These are 2 files containing Rexx procedures for controlling the
  3. screen with ANSI Codes.
  4.  
  5. Ansicode.cmd - Basic Ansicode procedure file
  6. Ansialt.cmd  - Alternative method. (Simplified, and more flexible)
  7. readme       - this file
  8.  
  9. Ansialt.cmd and ansicode.cmd CANNOT be used in the same rexx procedure,
  10. on account of the procedure names are the same.
  11.  
  12. By using a file of routines, you can cut and paste the routines you need
  13. into your own procedure, and since no DLL is required, the rexx script(s) 
  14. are easier to transport.
  15.  
  16. I believe this is ideal for those "Installation" scripts.
  17.  
  18. There are no "Keyboard redefinition" procedures included yet.
  19.  
  20. Basically there are 2 differen't ways to use these routines, the first is
  21. by calling the procedure:
  22.  
  23. Call Charout ,"Something "
  24. Call Color "RED","GREEN"  /* Make it look like fruit salad */
  25. Say "Warning"
  26. Call Color "White","Black"
  27.  
  28. or the alternative method:
  29.  
  30. Say "Something "Color("RED","WHITE")"Warning"Color("WHITE","BLACK")
  31.  
  32. Notice the alternative method requires only 1 line.
  33.  
  34. In addition, the alternative method can be used to store the ansi code in
  35. a variable, for later outpout:
  36.    H_atr = Csrattrib("REVERSE")
  37.    N_atr = Csrattrib("Normal")
  38.    Bar =  N_atr"This is normal"H_atr"This is highlighted"N_atr
  39.    Say Bar
  40. This has an advantage in speed, because the procedure does not need to
  41. run every time you display the variable 'Bar'.
  42.  
  43. Note to those who use the unix uqwk program for reading usenet newsgroups:
  44.   I've written a rexx program using some of the routines here and others
  45.   to sort, read and tag/select usenet messages from the summary files
  46.   uqwk puts out. I call the program 'readsum' and it is now in the "I'm looking
  47.   it over" stages. It is used to select usenet messages you are interested in. 
  48.   for later downloading into a soup (or QWK) packet for offline reading.
  49.   (Similiar to Ozcis Tag quick-scan option) If you are interested in using it,
  50.   or want a copy of it, please let me know, (it's about 900-1000 lines long, no
  51.   Dll's are used.)
  52.   
  53. I can be reached at: jhoglund@cscns.com 
  54.       or Compuserve: 70244,3234
  55.  
  56. Here are the routines:
  57. The Alternative method is listed second.
  58.  
  59. Locate:   Locate the cursor on the screen where you want it.
  60.           Call Locate Row,Col
  61.           Say Locate(Row,Col)
  62.  
  63. CsrUp:    Moves the cursor up a number of rows.
  64.           Call CsrUp Rows
  65.           Say CsrUp(Rows)
  66.  
  67. CsrDown: Moves the cursor down a number of rows.
  68.          Call CsrDn(Rows)
  69.          Say CsrDn(Rows)
  70.  
  71.  
  72. CsrRight: Moves the cursor right a number of columns 
  73.          Call CsrRight Cols
  74.          Say CsrRight(Cols)
  75.  
  76. CsrLeft: Moves the cursor left a number of columns
  77.          Call CsrLeft(Cols)
  78.          Say CsrLeft(Cols)
  79.          
  80.  
  81. SaveCsr: Save the cursor location to a string.
  82. PutCsr:  Restore the cursor location.
  83.  
  84.          PutCsr and SaveCsr are counterparts.
  85.  
  86.          Get the cursor location, Not in row format, but in a string
  87.          that PutCsr can use.
  88.          This is a convenient way to save the cursor position
  89.          prior to doing something, then use putcsr to restore the cursor.
  90.  
  91.          Old_location = SaveCsr()  /* Save screen position */
  92.          Say "some stuff...."
  93.          Call PutCsr Old_Location  /* Restore position */
  94.  
  95. Cls:     Clear entire screen.
  96.          Call Cls
  97.          Say cls() 
  98.  
  99.  
  100. CsrRow: Gets the current row
  101.         Row = CsrRow()
  102.  
  103. CsrCol: Get the current Column
  104.         Col = CsrCol()
  105.  
  106. Color: Sets the display colors
  107.        Call Color <ForeGround>,<BackGround>
  108.        Say Color(<Foreground>,<BackGround>)
  109.  
  110.        Colors are: BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE
  111.  
  112.  
  113. CsrAttrib: Sets the display attributes
  114.       call CsrAttrib <Attrib>
  115.       Say CsrAttrib(<Attrib>)
  116.  
  117.      <attrib> is one of the following:
  118.      NORMAL,HIGH,LOW,ITALIC,UNDERLINE,BLINK,RAPID,REVERSE
  119.  
  120.