Article 126637 of comp.os.vms:
Path: nntpd.lkg.dec.com!pa.dec.com!decwrl!enews.sgi.com!lll-winken.llnl.gov!fnnews.fnal.gov!usenet.eel.ufl.edu!news.mathworks.com!mvb.saic.com!info-vax
From: "Been There, Done That!" <BRIVAN@spire.com>
Newsgroups: comp.os.vms
Subject: re: FWD: help with ansi colors
Message-ID: <95Aug8.101447mdt.20489@twiki.spire.com>
Date: Tue, 8 Aug 1995 10:04:55 -0600
Organization: Info-Vax<==>Comp.Os.Vms Gateway
X-Gateway-Source-Info: Mailing List
Lines: 61

>$ BLACK    == "<ESC>Pp;S(M0(AD)7(AW));<ESC>\"
>$ RED      == "<ESC>Pp;S(M0(AR)7(AW));<ESC>\"
>$ GREEN    == "<ESC>Pp;S(M0(AG)7(AW));<ESC>\"
>$ CYAN     == "<ESC>Pp;S(M0(AC)7(AW));<ESC>\"
>$ YELLOW   == "<ESC>Pp;S(M0(AY)7(AW));<ESC>\"
>$ MAGENTA  == "<ESC>Pp;S(M0(AM)7(AW));<ESC>\"
>$ WHITE    == "<ESC>Pp;S(M0(AW)7(AD));<ESC>\"
>$ BLUE     == "<ESC>Pp;S(M0(AB)7(AW));<ESC>\"

I prefer to use the sequences in following program.  The above changes the
border color of my terminal.  I use the black as defined above to reset the
border if it ever changes due to REGIS programs.

I wasn't going to include the following to save bandwidth.  However, I need to
show the point.

The following will change the colors and not the border.  The program I
mentioned in a previous message will do the same thing as this DCL program, only
it's written in C as requested by the original poster.


Brian VandeMerwe
brivan@spire.com
sr. vms programmer

---- CUT HERE ----
$   page_size = F$getdvi("tt:", "tt_page")
$   devbufsiz = F$getdvi("tt:", "devbufsiz")
$
$   kntr1 = 0
$   kntr2 = 0
$
$   col = 1
$   row = 1
$
$   Write Sys$output "[2J"
$
$COLOR_LOOP:
$   Write Sys$output "[''row';''col'H[''kntr1';''kntr2'm''kntr1';''kntr2'[m
$
$   col = col + 7
$   If col .Ge. (devbufsiz - 7)
$   Then
$	col = 1
$	If (row .Lt. page_size - 1)
$	Then
$	    row = row + 1
$	Else
$	    Write Sys$output ""
$	Endif
$   Endif
$
$   kntr1 = kntr1 + 1
$   If kntr1 .Eq. 49
$   Then
$	kntr1 = 0
$	kntr2 = kntr2 + 1
$	If kntr2 .Eq. 49 Then EXIT
$   Endif
$
$   Goto COLOR_LOOP


