home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap12 / texed.c < prev   
Encoding:
C/C++ Source or Header  |  1988-04-07  |  819 b   |  34 lines

  1. /* texed.c  --  main entry point to the editor; the   */
  2. /*              menu and signal handlers are here     */
  3.  
  4. main(argc, argv)
  5. int argc;
  6. char *argv[];
  7. {
  8.     char ch;
  9.  
  10.     while (1)
  11.         {
  12.         printf("\nTexEd Main Menu\n");
  13.         printf("Select from:\n");
  14.         printf("0) Quit\n\n");
  15.         printf("1) Load File\n");
  16.         printf("2) Save File\n");
  17.         printf("3) Edit File\n");
  18.         printf("Which: ");
  19.         do
  20.             {
  21.             ch = getch();
  22.             ch -= '0';
  23.             } while (ch < 0 || ch > 3);
  24.         printf("%d\n\n", (int)ch);
  25.         switch(ch)
  26.             {
  27.             case 0: exit(0);
  28.             case 1: Load_file(); break;
  29.             case 2: Save_file(); break;
  30.             case 3: Edit_file(); break;
  31.             }
  32.         }
  33. }
  34.