home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / m / m071 / 1.img / C / SAMPLEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-20  |  1.4 KB  |  34 lines

  1. /*==================================================================*/
  2. /*     Sample program in C language to show files in CAP format.    */
  3. /*     By: Kuo Shiang Shiang (Djohan) & Jeng Shun Huo (Fire)        */
  4. /*                                                                  */
  5. /*     Compiler     :  Turbo C V1.5 or later                        */
  6. /*     Model        :  Huge                                         */
  7. /*     Project file :  SAMPLEC.PRJ                                  */
  8. /*     Library used :  CAP.OBJ                                      */
  9. /*==================================================================*/
  10.  
  11. extern int Show_CAP(char *);
  12. extern void Set_Screen_Mode(int);
  13.  
  14. main()
  15. {
  16.    int error_code=0;
  17.  
  18.    error_code = Show_CAP("SAMPLE.CAP");             /* Show "SAMPLE.CAP" */
  19.  
  20.    if (error_code==0) getch();            /* If no error, wait for a key */
  21.    Set_Screen_Mode(3);                 /* Switch back to color text mode */
  22.  
  23.    switch(error_code) {
  24.       case 1: printf("ERROR: The image file is not in CAP format!\7\n");
  25.               break;
  26.       case 2: printf("ERROR: File I/O error or file not found!\7\n");
  27.               break;
  28.       case 3: printf("ERROR: Not enough memory!\7\n");
  29.               break;
  30.       case 4: printf("ERROR: This file can't be shown in Chinese system!\7\n");
  31.               break;
  32.    }
  33. }
  34.