home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
ansicd.zip
/
readme
< prev
Wrap
Text File
|
1994-12-30
|
4KB
|
120 lines
These are 2 files containing Rexx procedures for controlling the
screen with ANSI Codes.
Ansicode.cmd - Basic Ansicode procedure file
Ansialt.cmd - Alternative method. (Simplified, and more flexible)
readme - this file
Ansialt.cmd and ansicode.cmd CANNOT be used in the same rexx procedure,
on account of the procedure names are the same.
By using a file of routines, you can cut and paste the routines you need
into your own procedure, and since no DLL is required, the rexx script(s)
are easier to transport.
I believe this is ideal for those "Installation" scripts.
There are no "Keyboard redefinition" procedures included yet.
Basically there are 2 differen't ways to use these routines, the first is
by calling the procedure:
Call Charout ,"Something "
Call Color "RED","GREEN" /* Make it look like fruit salad */
Say "Warning"
Call Color "White","Black"
or the alternative method:
Say "Something "Color("RED","WHITE")"Warning"Color("WHITE","BLACK")
Notice the alternative method requires only 1 line.
In addition, the alternative method can be used to store the ansi code in
a variable, for later outpout:
H_atr = Csrattrib("REVERSE")
N_atr = Csrattrib("Normal")
Bar = N_atr"This is normal"H_atr"This is highlighted"N_atr
Say Bar
This has an advantage in speed, because the procedure does not need to
run every time you display the variable 'Bar'.
Note to those who use the unix uqwk program for reading usenet newsgroups:
I've written a rexx program using some of the routines here and others
to sort, read and tag/select usenet messages from the summary files
uqwk puts out. I call the program 'readsum' and it is now in the "I'm looking
it over" stages. It is used to select usenet messages you are interested in.
for later downloading into a soup (or QWK) packet for offline reading.
(Similiar to Ozcis Tag quick-scan option) If you are interested in using it,
or want a copy of it, please let me know, (it's about 900-1000 lines long, no
Dll's are used.)
I can be reached at: jhoglund@cscns.com
or Compuserve: 70244,3234
Here are the routines:
The Alternative method is listed second.
Locate: Locate the cursor on the screen where you want it.
Call Locate Row,Col
Say Locate(Row,Col)
CsrUp: Moves the cursor up a number of rows.
Call CsrUp Rows
Say CsrUp(Rows)
CsrDown: Moves the cursor down a number of rows.
Call CsrDn(Rows)
Say CsrDn(Rows)
CsrRight: Moves the cursor right a number of columns
Call CsrRight Cols
Say CsrRight(Cols)
CsrLeft: Moves the cursor left a number of columns
Call CsrLeft(Cols)
Say CsrLeft(Cols)
SaveCsr: Save the cursor location to a string.
PutCsr: Restore the cursor location.
PutCsr and SaveCsr are counterparts.
Get the cursor location, Not in row format, but in a string
that PutCsr can use.
This is a convenient way to save the cursor position
prior to doing something, then use putcsr to restore the cursor.
Old_location = SaveCsr() /* Save screen position */
Say "some stuff...."
Call PutCsr Old_Location /* Restore position */
Cls: Clear entire screen.
Call Cls
Say cls()
CsrRow: Gets the current row
Row = CsrRow()
CsrCol: Get the current Column
Col = CsrCol()
Color: Sets the display colors
Call Color <ForeGround>,<BackGround>
Say Color(<Foreground>,<BackGround>)
Colors are: BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE
CsrAttrib: Sets the display attributes
call CsrAttrib <Attrib>
Say CsrAttrib(<Attrib>)
<attrib> is one of the following:
NORMAL,HIGH,LOW,ITALIC,UNDERLINE,BLINK,RAPID,REVERSE