home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!uunet.ca!canrem!dosgate!dosgate![harry.tempelman@canrem.com]
- From: "harry tempelman" <harry.tempelman@canrem.com>
- Subject: c menu program
- Message-ID: <19935.4577.16930@dosgate>
- Reply-To: "harry tempelman" <harry.tempelman@canrem.com>
- Organization: Canada Remote Systems
- Distribution: comp
- Date: 5 Jan 93 13:10:16 EST
- Lines: 103
-
-
- Can anyone enlighten me on the following topic.
-
- C MENU Program.
- The hardware platform is RISC RS/6000, AIX 3.2.2
-
- 2 Questions:
- How do I change the program with strcpy, system(cp) so that I can pass
- a value down?
- Is there a way to read more then one file & at the end rewind the tape?
-
- system("dd if=/dev/rmt1.1 of=/dev/tmp/"filename" ibs=1600 conv=sync");
-
-
- /* Menu program for CTad
-
- Date : 29-DEC-92
-
- File name daddy$sys:usr\tc\apex\menu.c
- File name apex:/home/operator/c/menu.c
-
- #include <stdio.h> /* includes */
- #include <stdlib.h>
- #include <ctype.h>
-
- #define CLS system("clear");
-
- /* prototypes of local functions */
- void menu_lable();
- void rmt1read();
-
- /* global variables */
- int i = 0;
-
- /****************************************************************************/
- /* the main program starts here:
- in this function we minimise the code and maximise clarity
- (divide & conquer) */
- /****************************************************************************/
- main()
- {
- menu_lable();
- start();
- }
-
- start()
- {
- char answer;
- {
-
- answer = getchar();
- answer = tolower(answer);
-
- switch (answer)
- {
- case 'a' : system("cd /u/ctad; /home/ctad/catiges"); main();
- case 'b' : system("cd /u/ctad; /home/ctad/integrator"); main();
- case 'c' : system("/home/ctad/wrtcat"); main();
- case 'd' : rmt1read();
- case 'q' : printf("menu end\n"); exit(1);
- default : printf("\nPlease try again"); sleep(1); main();
- }
- }
- return 0;
- }
-
- /****************************************************************************/
- /* display menu_lable */
- /****************************************************************************/
-
- void menu_lable()
-
- {
- CLS;
- {
- printf("\n\n\t\t\t Main Menu\n\n");
- printf("\t\t\t(A) IGES Conversion\n");
- printf("\t\t\t(B) PDGS to CATIA Menu\n");
- printf("\t\t\t(C) Write Ford Standard to CATIA\n");
- printf("\t\t\t(D) Tape Read Menu\n");
- printf("\t\t\t(E) Tape Write Menu\n");
- printf("\t\t\t(Q) Quit\n");
-
- printf("\n\t\t\t Choice: ");
- }
- }
-
- /****************************************************************************/
- /* display rmt1read_menu */
- /****************************************************************************/
-
- void rmt1read_menu()
- {
- CLS;
- {
- printf("\n\n\t\t\t Tape Read Menu\n\n");
-
- (Continued in the next message)
- ---
- ■ DeLuxe² 1.20 #11534 ■ REALITY.SYS Corrupted: Reboot universe? [Y/N]
- --
- Canada Remote Systems - Toronto, Ontario
- World's Largest PCBOARD System - 416-629-7000/629-7044
-