if statement - C# Error with 'continue' -


i'm trying use if statement bool make if code runs once not run again. here code using.

int random = program._random.next(0, 133);  if (random < 33) {    bool done = false;     if(done)    {       continue; // error shown statement    }     console.writeline("not done!");    done = true; } 

the error visual studio displaying is: "no enclosing loop out of break or continue".

depending on class/method requirements, possibly reverse logic:

 if (!done)  {    console.writeline("not done!");    done = true;  } 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -