Labeled Loop Statements

If a loop statement such as a for, foreach or while loop is labeled (a syntax normally only used in combination with the dreaded goto statement), RemObjects C# allows that name to be used to continue or break out of the loop without regard for nestings.

For example:

List<List<string>> myLists; // a list of lists
OuterLoop: foreach (List<string> l in myLists)
{
    foreach (string s in myLists)
    {
        if (s == "stop")
            break OuterLoop;
    }
}

See Also

Version Notes