returning a break?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jun 2 13:05:10 PDT 2008
"Rui Coelho Justino" <rmcjustino at gmail.com> wrote in message
news:g21hut$1pa7$1 at digitalmars.com...
> switch( int_case )
> {
> case 1, 0:
> Stdout( "Print 1" ).newline;
> function_that_breaks ( int_to_verify );
> case 2:
> Stdout( "Print 2" ).newline;
> if ( int_to_verify != 0 )
> {
> break;
> }
> case 3:
> Stdout( "Print 2" ).newline;
> if ( int_to_verify != 0 )
> {
> break;
> }
> }
>
> How should this function be setup?
> function_that_breaks ( int )
>
> using "return break;" doesn't work.
I'm not sure what language you're coming from. Returning flow control
structures doesn't sound like a common feature.
Just structure "case 1, 0:" like "case 2:" or "case 3:".
case 1, 0:
Stdout("print 1").newline;
if(function_that_breaks(int_to_verify))
break;
case 2:
*shrug*
More information about the Digitalmars-d-learn
mailing list