Continue in nested while loops

后端 未结 10 1573
名媛妹妹
名媛妹妹 2020-12-07 14:26

In this code sample, is there any way to continue on the outer loop from the catch block?

while
{
   // outer loop

   while
   {
       // inner loop
               


        
10条回答
  •  误落风尘
    2020-12-07 15:27

        while
        {
           // outer loop
    
           while
           {
               // inner loop
               try
               {
                   throw;
               }
               catch 
               {
                   // how do I continue on the outer loop from here?
                   goto REPEAT;
               }
           }
           // end of outer loop
    REPEAT: 
           // some statement or ; 
        }
    

    Problem solved. (what?? Why are you all giving me that dirty look?)

提交回复
热议问题