Visit our website at http://www.kalinabears.com.au
----- Original Message -----
From: Greg Wardawy <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 1:13 AM
Subject: Term::ANSIColor under Windows 2000


Hello,
Does anyone know how to use Term::ANSIColor under Windows 2000 (ansi.sys
loaded in config.nt) or how to use the W2K color command to get  different
parts of  text
displayed in different colors?
TIA
Greg

_______________________________________________
Hi Greg,
I think the ame problem exists on Win 98 - I don't have access to 2000 so I
can't check.

You probably think that 'reset' and 'clear' will revert the background to
black.
That's not the case - there are some strange rules regarding the meaning of
'reset'  and 'clear'.

Open a new box and try running this script four or more times and you will
probably see what I mean. For me, the first 2 times ( in command.com - 3
times in cmd.exe ) runs as you'd expect  but after that it becomes a bit
confusing.

 #!perl -w
use Term::ANSIColor;
print color 'bold blue on_white';
print "0\n";
print color 'reset';

print color 'bold blue on_magenta';
print "1\n";
print color 'reset';

print color 'bold blue on_yellow';
print "2\n";
print color 'reset';

print color 'bold blue on_green';
print "3\n";
print color 'reset';

One way I can get it to reliably produce the output of the first tries is to
rewrite it as follows:

#!perl -w
use Term::ANSIColor;
print color 'bold blue on_white';
print "0";
print color 'white on_black';
print "\n"; # You actually have to print something

print color 'bold blue on_magenta';
print "1";
print color 'white on_black';
print "\n";

print color 'bold blue on_yellow';
print "2";
print color 'white on_black';
print "\n";

print color 'bold blue on_green';
print "3";
print color 'white on_black';
print "\n";

I hope that's relevant to what you seek.

I haven't quite managed yet to put my finger on what exactly is going on.
I initially thought that resetting was simply reverting to the last set
color, but it's not as simple as that.

Cheers,
Rob

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to