Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rexx and Text Color

285 views
Skip to first unread message

Neil Haley

unread,
Jan 12, 2000, 3:00:00 AM1/12/00
to
Ok, another question, How would one color text in the SAY command

Example:
SAY Press 'GO' to contine.

Now, I want to alter the color for the word 'GO'
Neil 'Alien' Haley
==================
paintba...@videotron.ca
============================
CC#0023, SOG#25436, COPA#0008, PPIG#115, TIP#2372
=============================

dan...@crosslink.net

unread,
Jan 12, 2000, 3:00:00 AM1/12/00
to
>Example:
> SAY Press 'GO' to contine.

Working under OS/2 classic rexx, I use ANSI commands (which requires a
DEVICE=x:\os2\mdos\ansi.sys line in your config.sys file).

The following demonstrates:

/* */
aesc='1B'x
red_cy=aesc||'[31;46;m'
white_green=aesc||'[18;42;m'
normal=aesc||'[0;m'
bold=aesc||'[1;m'
reverse=aesc||'[7;m'

Say "This is normal"
say bold"This is bold"normal
say reverse"This is reverse"normal||bold||"and this is reverse"normal
say "Lastly: "red_cy||"Red on cyan! "normal||white_green" and white on green "normal

You can tinker with the the numbers for different colors.

-----------------------------------------------------------
Daniel Hellerstein
dan...@crosslink.net
http://www.srehttp.org
-----------------------------------------------------------


Patrick TJ McPhee

unread,
Jan 13, 2000, 3:00:00 AM1/13/00
to
In article <g5cp7sc4d07qcner7...@4ax.com>,
Neil Haley <paintba...@videotron.ca> wrote:

% Ok, another question, How would one color text in the SAY command

I'm not sure what platform you're on. If this is an mvs machine,
I dunno, but I used to (15 years ago) do user interface on VM
by driving X-Edit with Rexx. You could get different colours and
isolate input to certain parts of the screen, and it was way the
hell easier than using ISPF.

If you're on OS/2, as another respondent assumed, you can use ANSI
control sequences. You don't need ansi.sys, either.
nice = "1B"x"[42:35;1m"
bland = "1B"x"[40;37;0m"
call charout nice || "GO" || bland

If you are on OS/2, you could use rexxutil's sysgetkey and allow any keypress
to resume the forward motion of your program.

If you're on Windows '95 I think you can load ansi.sys and get the same
results.

If you're on Unix, most terminals (and Xterms) allow ansi colour control.
You could also use rxcurses, which probably has colour support.

On NT, the ansi codes won't work. If rxcurses does have colour support,
you could probaby use it.
--

Patrick TJ McPhee
East York Canada
pt...@interlog.com

Dennis Bareis

unread,
Jan 13, 2000, 3:00:00 AM1/13/00
to
dan...@crosslink.net wrote:
}Working under OS/2 classic rexx, I use ANSI commands (which requires a
}DEVICE=x:\os2\mdos\ansi.sys line in your config.sys file).

Under OS/2 ANSI is always availabel (it can be turned off but is on by
default), the above command enables ANSI for ALLl DOS & Windows sessions!

Bye
Dennis

----------------------------
Dennis Bareis (dba...@labyrinth.net.au)
Melbourne, AUSTRALIA.

http://www.labyrinth.net.au/~dbareis/index.htm

- Contains heaps of my own FREE software (OS/2, Windows, DOS & Linux):
* PPWIZARD (HTML/REXX/generic preprocessor - #define, #include, #import, #if)
Powerful macros, programmable, import SQL, auto tag examples, Text to HTML, template/style sheet design.
You WILL NOT find an easier to use or more powerful preprocessor than PPWIZARD.
Tested on OS/2, Windows, DOS & Linux (probably any Unix OK - if not help me make it so).
* Heaps more including rexx source code
----------------------------

Jim Kimball

unread,
Jan 13, 2000, 3:00:00 AM1/13/00
to
Hello,
I call the following subroutine then use the colors' name.

Colors:
ansii.esc = '1B'x
c.normal = ansii.esc || '[0m'
c.highlite = ansii.esc || '[1m'
c.blackback = ansii.esc || '[40m'
c.red = c.normal || ansii.esc || '[31m'
c.green = c.normal || ansii.esc || '[32m'
c.yellow = c.normal || ansii.esc || '[33m'
c.blue = c.normal || ansii.esc || '[34m'
c.magenta = c.normal || ansii.esc || '[35m'
c.cyan = c.normal || ansii.esc || '[36m'
c.grey = c.normal || ansii.esc || '[37m'
c.ltred = c.highlite || ansii.esc || '[31m'
c.ltgreen = c.highlite || ansii.esc || '[32m'
c.ltyellow = c.highlite || ansii.esc || '[33m'
c.ltblue = c.highlite || ansii.esc || '[34m'
c.ltmagenta = c.highlite || ansii.esc || '[35m'
c.ltcyan = c.highlite || ansii.esc || '[36m'
c.white = c.highlite || ansii.esc || '[37m'
c.std = c.normal || c.grey || c.blackback
c.reset = c.normal || c.grey || c.blackback
return

Jim.

Patrick TJ McPhee wrote in message ...

Michael Lueck

unread,
Jan 14, 2000, 3:00:00 AM1/14/00
to
Say, you don't happen to know the codes to make text blink do you? I know
there are some more ANSI codes which can be used, but no longer have access to

the source code to look them up.

Michael

Jim Kimball wrote:

> Hello,
> I call the following subroutine then use the colors' name.
>

> <code snip>


0 new messages