Subj : Re: Syntax, style, the infinite monkey theorum and coding To : comp.programming From : Steve O'Hara-Smith Date : Tue Aug 23 2005 11:56 pm On Tue, 23 Aug 2005 15:33:17 GMT CBFalconer wrote: > Gerry Quinn wrote: > > m.fee@iirrll..ccrrii..nnzz says... > > I prefer the style: > > > > while( true ) > > { > > if ( ! condition1 ) break; > > if ( ! condition2 ) break; > > // do stuff > > } > > > > But not everyone likes that either. > > And I would use: > > if (!condition1) failure(1); How do you make the failure() function terminate the loop ? I suppose you could se a global in failure() and test it in the condition, or make failure a macro with a break in it - but what did you have in mind ? > else if (!condition2) failure(2); > else if (!condition3) failure(3); > else { /* all well */ > dostuff(); > } -- C:>WIN | Directable Mirror Arrays The computer obeys and wins. | A better way to focus the sun You lose and Bill collects. | licences available see | http://www.sohara.org/ .