While executing the below code, I expected to get the PLAYER MENU string in red and blinking mode. However, I do not get so. Please help me as I need to get this code ready ASAP.
Note : Have tried textattr () function as well. I'm using Turbo C++ Version 3.0.
PS : Sorry for posting such a long code for such a minor error. Thank you for your time and energy.
See this code:
void menu ()
{
int x1, y1, x2, y2, x3, y3;
char choice;
textcolor (YELLOW);
textbackground (0);
do
{
clrscr ();
disptime ();
cout << "\t ";
x1 = wherex ();
y1 = wherey ();
for (int i = 1; i <= 55; i ++)
cout << "_";
x2 = wherex () - 1;
y2 = wherey ();
gotoxy (x1, y1 + 1);
cout << "|";
gotoxy (x2, y2 + 1);
cout << "|";
gotoxy (x1, y1 + 2);
cout << "|";
gotoxy (x2, y2 + 2);
cout << "|";
gotoxy (x1, y1 + 3);
cout << "|";
textcolor (RED + BLINK);
cout << "\t\t PLAYER MENU";
textcolor (YELLOW);
gotoxy (x2, y2 + 3);
cout << "|";
gotoxy (x1, y1 + 4);
cout << "|";
gotoxy (x2, y2 + 4);
cout << "|";
gotoxy (x1, y1 + 5);
cout << "|";
cout << "\t\t (1) Enter new player";
gotoxy (x2, y2 + 5);
cout << "|";
gotoxy (x1, y1 + 6);
cout << "|";
cout << "\t (2) Update player details";
gotoxy (x2, y2 + 6);
cout << "|";
gotoxy (x1, y1 + 7);
cout << "|";
cout << "\t\t (3) Modify player details";
gotoxy (x2, y2 + 7);
cout << "|";
gotoxy (x1, y1 + 8);
cout << "|";
cout << "\t (4) Search player";
gotoxy (x2, y2 + 8);
cout << "|";
gotoxy (x1, y1 + 9);
cout << "|";
cout << "\t (5) Delete player";
gotoxy (x2, y2 + 9);
cout << "|";
gotoxy (x1, y1 + 10);
cout << "|";
cout << "\t (6) Hourly Lucky Draw";
gotoxy (x2, y2 + 10);
cout << "|";
gotoxy (x1, y1 + 11);
cout << "|";
cout << "\t (7) Silver Club Championship";
gotoxy (x2, y2 + 11);
cout << "|";
gotoxy (x1, y1 + 12);
cout << "|";
cout << "\t (8) Instruction manual";
gotoxy (x2, y2 + 12);
cout << "|";
gotoxy (x1, y1 + 13);
cout << "|";
cout << "\t (9) System Settings";
gotoxy (x2, y2 + 13);
cout << "|";
gotoxy (x1, y1 + 14);
cout << "|";
cout << "\t (0) Exit";
gotoxy (x2, y2 + 14);
cout << "|";
gotoxy (x1, y1 + 15);
cout << "|";
gotoxy (x2, y2 + 15);
cout << "|";
gotoxy (x1, y1 + 16);
cout << "|";
cout << "\t\t Enter your choice here :- ";
x3 = wherex ();
y3 = wherey ();
gotoxy (x2, y2 + 16);
cout << "|";
gotoxy (x1, y1 + 17);
cout << "|";
gotoxy (x2, y2 + 17);
cout << "|";
gotoxy (x1, y1 + 18);
cout << "|";
gotoxy (x2, y2 + 18);
cout << "|";
gotoxy (x1, y1 + 19);
cout << "|";
gotoxy (x2, y2 + 19);
cout << "|";
gotoxy (x1, y1 + 20);
cout << "|";
gotoxy (x2, y2 + 20);
cout << "|";
gotoxy(x1, y1 + 20);
for (i = 1; i <= 55; i ++)
cout << "-";
gotoxy (x3, y3);
choice = getche ();
switch (choice)
{
case '1' : newplayer ();
break;
case '2' : update ();
break;
case '3' : break;
case '4' : break;
case '5' : break;
case '6' : break;
case '7' : break;
case '8' : break;
case '9' : break;
case '0' : break;
default : gotoxy (x1 + 1, y1 + 18);
cout << "\t\t Invalid choice. Try again!!!";
getch ();
}
} while (choice != '0');
}