HP 3000 Manuals

Labeled Statements [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Reference Manual

Labeled Statements 

Labeled statements are those preceded by a label.

Syntax 

     labeled-statement ::=
        identifier : statement 
        case constant-expression : statement 
        default: statement 

Description 

You can prefix any statement using a label so at some point you can
reference it using goto statements.  This includes statements already
having labels.  In other words, any statement can have one or more labels
affixed to it.

The case and default labels can only be used inside a switch statement.
These are discussed in further detail in the section on the switch
statement appearing later in this chapter.

Example 

     if (fatal_error)
        goto get_out;
        .
        .
        .
     get_out: return(FATAL_CONDITION);



MPE/iX 5.0 Documentation