home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light
/
Light_Vol.1_June_1992_Datasphere_Publications_Disk_1_of_2_Side_A.d64
/
c-menu.c
< prev
next >
Wrap
Text File
|
2023-02-26
|
2KB
|
56 lines
/*
Menu Program - Chapter 1
note: This listing is slightly different to that in the
accompanying text. I have accomodated 40 and 80
column screen displays with the help of the is80()
function.
*/
#include "stdio.h"
#include "ctype.h"
#define clear_screen printf("\223")
main()
{SHIFT-+}
char choice,temp;
int column;
if (is80()) /* C64 users remove the is80() */
column = 25; /* if else statement and replace */
else /* with column = 10; */
column = 10;
while (choice != 'Q')
{SHIFT-+}
clear_screen;
cursor(3,column+8);printf("MENU");
cursor(6,column);printf("1. Variables");
cursor(8,column);printf("2. Functions");
cursor(10,column);printf("3. Arrays & Pointers");
cursor(12,column);printf("4. Files");
cursor(14,column);printf("Q. Quit");
cursor(20,column+1);printf("Enter Choice (1-4) or Q: ");
temp = getchar();
choice = toupper(temp);
switch(choice) {SHIFT-+}
case '1' : putchar(choice); exec("variables"); break;
case '2' : putchar(choice); exec("functions"); break;
case '3' : putchar(choice); exec("arrays"); break;
case '4' : putchar(choice); exec("files"); break;
case 'Q' : cursor(22,column+2);printf("Quit!...press a key");
{SHIFT--}
{SHIFT--}
getchar();
{SHIFT--}