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 -

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

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -