Menu System in Turbo Pascal 7.0 
Author Message
 Menu System in Turbo Pascal 7.0

Can anyone point me to a tutorial or webpage that explains how to code a
menu system for databases or games.

Please!

Thanx in advance.



Mon, 17 Mar 2003 03:00:00 GMT  
 Menu System in Turbo Pascal 7.0
On Thu, 28 Sep 2000 14:57:13 -0700, "Jaco Wiese"

Quote:

>Can anyone point me to a tutorial or webpage that explains how to code a
>menu system for databases or games.

>Please!

>Thanx in advance.

{ This is about as simple as you can get. There are other bells and
whistles you can add but this "quicky", done some time ago, should
get you started.

Program EasyMenu;
{ Clif Penn    Nov 22, 1995   written in Turbo v 6.0
    This simple REPEAT..UNTIL menu program uses several features
of Turbo's CRT Unit and can be modified for many different user
applications. Menu selections are by single key presses. Wrong
entries are not accepted (BUT do no harm!) and a beep warns. The
conventional EXIT command is not used so that (1) files can be
updated, deleted, closed, etc., (2) the screen can be left blank
and (3) any other closing action you wish. }

Uses CRT;

VAR
Ch:Char;
Row, Col:Integer;

Procedure OneKey;
Begin
WriteLn('You pressed numeric key "1".');
End;

Procedure TwoKey;
Begin
WriteLn('You must have pressed numeric key "2".');
End;

Procedure ThreeKey;
Begin
WriteLn('Did you press numeric key "3"?');
End;

Procedure DisplayMenu;
Begin
     WriteLn('**********************MENU*************************');
     WriteLn;
     WriteLn('1. Actions for pressing numerical key <1> ');
     WriteLn('2. Actions for pressing numerical key <2> ');
     WriteLn('3. Actions for pressing numerical key <3> ');
     Write('           PRESS Q TO QUIT');
     WriteLn;  WriteLn;  Write('Make Selection: ');
End;

Procedure Depart(VAR Response:Char);
Begin
     WriteLn('Store data, close files, etc. Good Bye!');
     Write('DO YOU REALLY WANT TO QUIT (Y/N): ');
     Response := UpCase(ReadKey);
     If Response <> 'Y' Then  {do not quit}
     Begin
          ClrScr;
          DisplayMenu;
     End;
End;

BEGIN  {menu program}
      ClrScr;
      DisplayMenu;
      Col := WhereX;  Row := WhereY;
Repeat
      Ch :=ReadKey;  {pauses for keypress}
      Write(Ch);     {ReadKey does not echo}
      GoToXY(5, 10);
      ClrEol;
      CASE Ch of
           '1' :  OneKey;
           '2' :  TwoKey;
           '3' :  ThreeKey;
           'Q', 'q' : Depart(Ch);
            Else Write(Chr(7)); { beep }
      End;
      GoToXY(Col, Row);
Until Ch = 'Y';
ClrScr;
End.



Mon, 17 Mar 2003 03:00:00 GMT  
 Menu System in Turbo Pascal 7.0

Quote:
> Can anyone point me to a tutorial or webpage that explains how to code a
> menu system for databases or games.

> Please!

> Thanx in advance.

Can you be more specific: How advandced must it be? Graphical or text modus?
Mousedriven? Which Pascal do you use (more important if using
graphics/mouse)? A menu sytem: you mean something like 'File', 'Edit', etc.
in Win or just a menu using buttons, or just a routine asking for a choice
between some menu options? How much do you want to know? Main structure of
subroutines or specific routines being (text) graphical routines? Just a
menu structure or a complete (Graphical) User Interface? (Do you use Win?)
Must it be capable of being adapted to any program?

KuifWare
http://kuifware.freeservers.com



Mon, 17 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I would like to know the difference between Borland Pascal 7.0 and Turbo Pascal 7.0

2. Turbo Pascal 7.0 vs Borland Pascal 7.0

3. How might I get Turbo Pascal 7.0 and Turbo Debugger 4.6 to play together

4. I NEED TURBO PASCAL 7.0 HELP FILE (TURBO.TPH)

5. Turbo Pascal 7.0 vs Turbo C++ 3.1

6. Does anybody want to help me make an operating system in pascal 7.0

7. Borland Pascal 7.0 (DOS) and SYSTEM.PAS

8. Menu System Help

9. Menu System?

10. Please help MENU SYSTEM

11. TPW - Modify the system menu

12. catching the system menu close choice

 

 
Powered by phpBB® Forum Software