Pause und label, die "Das label MyLabel fehlt"

Ich habe einen code wie folgt:

if(condition1)
{
    break MyLabel;
}
while(true)
{
    //some code here
    MyLabel: if(condition2) break;
    //more code here
}

und ich bekomme diese Fehlermeldung:

Dem label MyLabel fehlt.

Was ist falsch?

InformationsquelleAutor der Frage Lrrr | 2012-01-10

Schreibe einen Kommentar