Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a way to change color on text being displayed 1

Status
Not open for further replies.

sonic86

IS-IT--Management
Mar 22, 2002
6
US
I am trying to make display a string on the terminal screen. Is there a way to change the color or even make it flash?
 
If you use the correct escape sequences for the terminal emulation you are using, then the answer is yes. It shouldn't be hard to find these for the ANSI BBS and VT emulations, but I'm not sure how well documented (on the Internet, I don't believe any information of this type is in the help files) it is for the other emulations in Procomm.
 
I am using the ANSI emulation, but there is no help in Procomm for it. Any idea where i could find some?
 
Hello,

The Escape Sequences that Knob talked about are what we use in the Nortel World with the VT-100 Family of Terminal Interfaces. In Nortel we use a HEXTOSTR Command. ( Hexidecimal to String ) to ALTER Colors, Blinks, Etc ! The HEXTOSTR Command Tells the VT-100 how to behave.. Not much help here; but I'll contact some Friends and see what I can Find Out.

Example in Nortel SFDEV Scripts:

DOUBLE HEIGTH WORDS

PRINT ‘ HANK ‘ ( HEXTOSTR #1B #23 #33 )
PRINT ‘ HANK ‘ ( HEXTOSTR #1B #23 #34 )

THE WORD HANK WILL BE DISPLAYED IN DOUBLE HEIGTH LETTERS.


Just an Idea !

Hank
 
Here's a web site I found while searching on Google with the terms ANSI and escape sequence that looks like it may be of use:
To write a string to the terminal, just use the termmsg, termwrites, or termputs command, whichever is most appropriate to your need. Use ^[ to represent an escape character in your strings where necessary.
 
Ok I've tried a couple things, but it doesn't seem to be displaying properly. Here's an example of what I'm doing.

termmsg "^[1;5;31 TEST"

Is that the improper format. It just displays

^[1;5;31 TEST
 
Oops! I reread the help file for the termmsg command and I didn't notice the first time that termmsg does not support caret (^) sequences, so you'll need to use either termwrites or termputs.

When I tried your string with the termwrites command, I was initially seeing the same output you were. I added an extra left bracket to the command and only TEST was output, but I didn't see any attributes being set on the text. I added an m to the end of the string and this resulted in TEST being displayed in red and flashing. Is that the result you were looking for? Here's the command as it looked when I finished it:

termwrites "^[[1;5;31m TEST"
 
Doggone escape sequences always drive me nuts. I loved trying to interpret what a user was seeing by reading the contents of the monitor window, character by character, over the phone and then looking in an escape sequence table. Such fun!
 
Thank You Knob and hankm3 both for your help. Everything is working great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top