home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!gatech!destroyer!cs.ubc.ca!bcsystems!cconstantine
- From: cconstantine@galaxy.gov.bc.ca
- Newsgroups: comp.sys.mac.programmer
- Subject: One routine works, the other doesnt, WHY??
- Message-ID: <1992Dec29.121933.1426@galaxy.gov.bc.ca>
- Date: 29 Dec 92 12:19:33 -0800
- Organization: BC Systems Corporation
- Lines: 33
-
- Could someone please explain to me why the following routine gets compile time
- errors under MPW C 3.2.4:
-
- curDev = GetMainDevice();
- pixDepth = GetPixelDepth( curDev );
- if ( pixDepth <> 8 )
- DeathAlert( errNot8Bit );
-
-
- but the following routine both compiles _AND_ works????!!!!!!
-
- curDev = GetMainDevice();
- pixDepth = GetPixelDepth( curDev );
- switch ( pixDepth )
- {
- case 8:
- break;
- default:
- DeathAlert( errNot8Bit );
- break;
- }
-
- I've mentioned the first one before, but now that I've _fixed_ the problem, I'm
- really confused as to why I got the errors in the first place. I would prefere
- to use only a few lines of code (4) as opposed to many (almost 10 including
- begin and end brackets)!!!!!
-
-
- Thanks for any help.
-
-
- Carl B. Constantine
- CCONSTANTINE@galaxy.gov.bc.ca
-