continue with next case

Prev Next

Function Names

continue with next case

Description

Inside the case() of a switch() or check() block, continue with next case stops executing further statements in the current case block and continues with the next case block regardless of the value checked.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

0

Examples

for (a[] = 1, a[] <= 3, a[]++)
{
    print ( "Switch Loop ",a[], ":   " );
       switch( a [] )
       {
           case (1)
           {
               print("Case 1; ");
               continue with next case;
               print("Skipped;  "); // This statement will not be executed:
           }
           case (2)
           {
               print("Case 2; ");
               continue case;
           }
           case (3)
           {
               print("Case 3; ");
               break case;
           }
       }
       echo;
}

Output

Switch Loop 1:   Case 1; Case 2;
Switch Loop 2:   Case 2;
Switch Loop 3:   Case 3;
Try it yourself: Open LIB_Function_continue_with_next_case.b4p in B4P_Examples.zip. Decompress before use.

See also

continue
switch
check