0

im making a program and when you select exit in the menu i want it to be like:

Are you sure you want to exit?

Yes No
Enter Esc

so when you press enter it will exit and when u press esc it will go back to the menu. everything iv tried didn't work. is it even possible to do this?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by killhha
1

I have a procedure just made ....
:)

Program Program01;

Uses Crt;

Procedure ExitOrNot;
   Var C:Char;
   Begin
      WriteLn('Are sure you want to exit?');
      Write('Enter to quit or Esc to continue');
      C:=ReadKey;
      WriteLn;
      Case (C) Of
         #13:Halt;
         #27:Write('We are going back...');
      End;
   End;

Begin {main}
     {call our procedure...}
     ExitOrNot;

     ReadKey;
End.{main}

{
-= Note By FlamingClaw =-
#13 = Enter(from ascii)
#27 = Esc
-=Created By FlamingClaw=-
-=2009.03.20=-
}
Votes + Comments
Helped me with a problem in pascal
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.