Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

HP OpenVMS Systems

Ask the Wizard
» 

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
Content starts here

Ask the Wizard Questions

DECterm text color

The Question is:

Dear Wizard,

I'm in seoul, korea.

I tried to find out how to get color text at DECterm in
OpenVMS/AXP for days. but just failed.

you know, I coded some C program which produce
 "hello, world" in reverse
video mode or be underlined like the following :

        main()
        {
                /* "[7mhello,world[m" */
                putchar(0x1b);
                putchar('[');
                putchar('7');
                putchar('m');
                printf("hello, world\n");
                putchar(0x1b);
                putchar('[');
                putchar('m');
        }

and I succeeded.

But I couldn't find out how to get RED "hello, world" or
BLUE "hello, world" at DECterm in OpenVMS/AXP.

I think that getting a RED or BLUE text is similar to
that of reverse.

Please help me. And I would appreciate your kindness.
Thanks.


The Answer is:

I wrote this DCL some time ago (COLORS.COM):

$!
$       esc[0,7]=27
$       black == 0
$       red == 1
$       green == 2
$       yellow == 3
$       blue == 4
$       purple == 5
$       lightblue == 6
$       white == 7
$       foreground == 30
$       background == 40
$       normal == "''esc'[0m"
$       ws:= write sys$output
$       color0 = "black"
$       color1 = "red"
$       color2 = "green"
$       color3 = "yellow"
$       color4 = "blue"
$       color5 = "purple"
$       color6 = "lightblue"
$       color7 = "white"
$!
$!
$       ws "Demonstrating changed foregrounds"
$       counter = 0
$ loop1:
$       bg = 0 ! "normal" background
$       fg = 30 + counter
$       a = color'counter'
$       ws "''esc'[''bg';''fg'm", "This is ", ''a', normal
$       counter = counter + 1
$       if counter .lt. 8 then goto loop1
$!
$       ws "Demonstrating changed backgrounds"
$       counter = 0
$ loop2:
$       bg = 40 + counter
$       fg = 30 ! "black" foreground
$       a = color'counter'
$       ws "''esc'[''bg';''fg'm", "This is ", ''a', normal
$       counter = counter + 1
$       if counter .lt. 8 then goto loop2
$ exit



 

** About PDF files: The PDF files on this Web site can be read online or printed using Adobe® Acrobat® Reader. If you do not have this software installed on your system, you may download it from the Adobe Web site.
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.