Operating System - HP-UX
1751693 Members
4780 Online
108781 Solutions
New Discussion юеВ

Re: Need command to change colour of a database's background

 
Rudi Martin
Advisor

Need command to change colour of a database's background

Hi all

I have a menu where people login to and they get an option of a Live DB and a Test DB. Is there any command that I can use to force the background colour to change when they do select the Test DB ?

Any ideas ?
6 REPLIES 6
Tony Horton
Frequent Advisor

Re: Need command to change colour of a database's background

Hi Rudi,

I guess it depends on what you are using to access the database in the first place? If its a terminal (or terminal emulator) you could try using ansi escape characters to change the font's foreground or background colour (although it may not work quite how you want).

echo "\033[43m" will change the background colour under any text the various esc codes for the colours can be found here http://www.bluesock.org/~willg/dev/ansi.html

Regards,

Tony.
No man is an isthmus
Rudi Martin
Advisor

Re: Need command to change colour of a database's background

Hi there.

Ok , attached is the menu. We access from normal VT200-7BIT emulator.

I want the test to run in a different background colour.
Tony Horton
Frequent Advisor

Re: Need command to change colour of a database's background

Well if you did this then it might (depending on how your emulation program works) work.

change (in a non live copy) this line

2) $MFGE/mfgpro90t $MFGTEST/mfg9-0a $MFGTEST/gui9-0a $MFGE/hlp9-0a $MFGE/cfg9-0a $MFGTEST/epm9-0a $MFGE/kbn9-0a;;

To

2) echo "\033[43m"; $MFGE/mfgpro90t $MFGTEST/mfg9-0a $MFGTEST/gui9-0a $MFGE/hlp9-0a $MFGE/cfg9-0a $MFGTEST/epm9-0a $MFGE/kbn9-0a; echo "\033[40m";;

I've attached what that does on our progress system (normally it has black background)Probably not really what you want, though your emulator may properly make the entire background the background colour not just the stuff under the text like ours.

If you want to see how it will look before doing any script changes, just do the command echo "\033[43m" on the command line before starting up MFG Pro. You might also want to do echo "\033[2J" (or a clear) which is supposed to clear the screen to the colour of the background set above (I just tried it with XP's built in telnet and it worked a treat).

of course you can try different colours ;-)

Regards,

Tony.
No man is an isthmus
Tony Horton
Frequent Advisor

Re: Need command to change colour of a database's background

I told a slight fib.... The XP telnet does set the screen background but when I start up progress it changes the background colour back to black! So although it might work, it's probably a bit on the dodgy side :-)
No man is an isthmus
Rudi Martin
Advisor

Re: Need command to change colour of a database's background

Thanx for your help so far , but I tried copying that code that you added , and it's not changing anything.

From the command prompt it works fine through my emulator , but just not in the menu itself.

Tony Horton
Frequent Advisor

Re: Need command to change colour of a database's background

Hi Rudi,

When you say it works fine from the command prompt, does the screen stay that colour when you start up the test database or does it revert back to the default colour?

you could try taking out the second escape code, although It shouldn't be executed until after the user quits the database. It is basically there to reset the background colour to normal.

If it reverts back to the normal colour at the point when you select the test database, then it is probably MFG Pro sending an esc seq to reset the terminal to defaults.

Regards,

Tony.
No man is an isthmus