Results 1 to 4 of 4

Thread: Exit Sub in C#?

Hybrid View

  1. #1
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492

    Re: Exit Sub in C#?

    Quote Originally Posted by mendhak
    I'm inside a for loop. How do I exit the for loop? And the sub?
    C# = C++ when it comes to exiting.

    Code:
    for(int i = 0; i<10; i++)
     {
       if (!(i%2))
           //divisible by 2
        break; //break outter for
       ....
      }
    
    return; //get out of routine...although you should return some sort of status

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Exit Sub in C#?

    I see, thanks a break!;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width