Thread: more code help

  1. #1
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608

    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
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    use goto. or if that makes you grimace, use a while loop and a flag.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM