home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20471 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.2 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!gatech!destroyer!cs.ubc.ca!bcsystems!cconstantine
  2. From: cconstantine@galaxy.gov.bc.ca
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: One routine works, the other doesnt, WHY??
  5. Message-ID: <1992Dec29.121933.1426@galaxy.gov.bc.ca>
  6. Date: 29 Dec 92 12:19:33 -0800
  7. Organization: BC Systems Corporation
  8. Lines: 33
  9.  
  10. Could someone please explain to me why the following routine gets compile time
  11. errors under MPW C 3.2.4:
  12.  
  13. curDev = GetMainDevice();
  14. pixDepth = GetPixelDepth( curDev );                             
  15. if ( pixDepth <> 8 )                                            
  16.     DeathAlert( errNot8Bit );
  17.  
  18.  
  19. but the following routine both compiles _AND_ works????!!!!!!
  20.  
  21.                 curDev = GetMainDevice();
  22.         pixDepth = GetPixelDepth( curDev );
  23.         switch ( pixDepth )
  24.         {
  25.             case 8:
  26.                 break;
  27.             default:
  28.                 DeathAlert( errNot8Bit );
  29.                 break;
  30.         }
  31.  
  32. I've mentioned the first one before, but now that I've _fixed_ the problem, I'm
  33. really confused as to why I got the errors in the first place.  I would prefere
  34. to use only a few lines of code (4)  as opposed to many (almost 10 including
  35. begin and end brackets)!!!!!
  36.  
  37.  
  38. Thanks for any help.
  39.  
  40.  
  41. Carl B. Constantine
  42. CCONSTANTINE@galaxy.gov.bc.ca
  43.