-
more code help
Code:
#include <iostream>
#include <string>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
using namespace std;
float menuselect;
int main()
{
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
textcolor(WHITE);
clrscr();
cout << endl ;
cout << endl ;
cout << endl ;
cout <<" Press the number next to the seleleciton to select" << endl ;
cout <<" &&&&&&&&&&&&&&&&&&&&&&&&&&-MENU-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl ;
cout <<" & &" << endl ;
cout <<" & 1. Storyline 2. New Game &" << endl ;
cout <<" & &" << endl ;
cout <<" & &" << endl ;
cout <<" & 3. Load Game 4. Credits &" << endl ;
cout <<" & &" << endl ;
cout <<" & Press alt-tab to downsize window. &" << endl ;
cout <<" & Press Escape at anytime to leave. &" << endl ;
cout <<" & &" << endl ;
cout <<" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl ;
cin >> menuselect;
if (menuselect == '1') {
textcolor(RED);
clrscr();
//this is a bucnh of couts, after this it needs to go back to the menu
}
//else if (menuselect == '2')
//else if (menuselect == '3')
//else if (menuselect == '4')
cin.get();
return 0;
}
Previous message was not received by El Chulo Matatan because of error: Your message was refused by the AOL Instant Messenger server, probably because the message was too big. Try making the message shorter and send it again.
El Chulo Matatan: shoot
Klinerr1:
#include <iostream>
#include <string>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
using namespace std;
float menuselect;
int main()
{
cout <<" Press the number next to the seleleciton to select" << endl ;
cout <<" &&&&&&&&&&&&&&&&&&&&&&&&&&-MENU-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl ;
cout <<" & &" << endl ;
cout <<" & 1. Storyline 2. New Game &" << endl ;
cout <<" & &" << endl ;
cout <<" & &" << endl ;
cout <<" & 3. Load Game 4. Credits &" << endl ;
cout <<" & &" << endl ;
cout <<" & Press alt-tab to downsize window. &" << endl ;
cout <<" & Press Escape at anytime to leave. &" << endl ;
cout <<" & &" << endl ;
cout <<" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl ;
cin >> menuselect;
if (menuselect == '1') {
textcolor(RED);
clrscr();
//this is a bucnh of couts, after this it needs to go back to the menu
}
//else if (menuselect == '2')
//else if (menuselect == '3')
//else if (menuselect == '4')
cin.get();
return 0;
}
i want it so after the menu select 1 is done it goes back to the menu. ignore all the xtra headers
-
use goto. or if that makes you grimace, use a while loop and a flag.