home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_11 / 1011086c < prev    next >
Text File  |  1992-10-05  |  601b  |  30 lines

  1.  
  2.  
  3. Loop-break Approach (Raymond Lutz's approach)
  4.  
  5. static int /* status */
  6. general_routine ()
  7.    {
  8.      int status = STS_OK;
  9.      
  10.      do {
  11.           if (<error condition 1>)
  12.                     {
  13.                     status = ERROR_CODE_1;
  14.                     break;
  15.                     }
  16.           if (<error conditon 2>)
  17.                     {
  18.                     status = ERROR_CODE_2;
  19.                     break;
  20.                     }
  21.           ...
  22.           <more error checking>
  23.           <finally do something>
  24.           } while (FALSE);
  25.      return (status);
  26.    }
  27.  
  28.  
  29.  
  30.