I am using ANSI escape codes in my semi-graphical
program...
my problem is this i have
1 2
|
#define RED "\033[7;31m"
#define GREEN "\033[1;32m"
|
no problems with this...
later in my program i have this
1 2 3
|
printf(RED);
printf(GREEN);
printf(msg);
|
msg is something like "hello world"
the problem with the above is that
it will print red bg with black txt or
white on black
i have also tried
1 2 3 4 5 6 7
|
char message[50];
message[0]='\n';
//requires string.h
strcat(message, GREEN);
strcat(message, RED);
strcat(message,msg);
printf(message);
|
does the same thing as the other one
I cannot declare them in one line e.g.
|
printf(RED GREEN "%s", msg);
|
im using hundreds of escape codes so itd take me months...
|
if (background==red && text==green && bold==none)
|
one of these plus the printf line about 400 times so
what should be a 250-300 line program becomes 1000
1 2 3 4 5
|
if (noone==canHelp)
{
//begin 1000 lines...
code(1000);
}
|