我有這樣的代碼:我怎樣才能繼續上面的圈
foreach(int i in Directions)
{
if (IsDowner(i))
{
while (IsDowner(i))
{
continue;
//if (i >= Directions.Count)
//{
// break;
//}
}
//if (i >= Directions.Count)
//{
// break;
//}
if (IsForward(i))
{
continue;
//if (i >= Directions.Count)
//{
// break;
//}
//check = true;
}
//if (i >= Directions.Count)
//{
// break;
//}
if (IsUpper(i))
{
//if (i >= Directions.Count)
//{
// break;
//}
num++;
//check = false;
}
//if (check)
//{
// num++;
//}
}
}
,但我希望有continue
爲foreach
在while
循環。我怎樣才能做到這一點?
相關:http://stackoverflow.com/questions/8497247/break-nested-loops – CodesInChaos 2012-02-05 10:03:42