YENGbreak

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Add into category)
m (Indentation)
Line 1: Line 1:
 
break can be used to jump out of do...while, while and for() loops ( or case clauses )
 
break can be used to jump out of do...while, while and for() loops ( or case clauses )
  
−
string error = "";
+
string error = "";
−
while(true)
+
 
−
{
+
while(true)
−
  if(blabla)
+
{
−
  {
+
    if(blabla)
−
    error = "blabla";
+
    {
−
    break;
+
        error = "blabla";
−
  }
+
        break;
−
  if(bla)
+
    }
−
  {
+
    if(bla)
−
    error = "bla";
+
    {
−
    break;
+
        error = "bla";
−
  }
+
        break;
−
  break;
+
    }
−
}
+
    break;
 +
}
  
 
[[Category:Scripts]]
 
[[Category:Scripts]]

Revision as of 05:40, 22 September 2020

break can be used to jump out of do...while, while and for() loops ( or case clauses )

string error = "";

while(true) {

   if(blabla)
   {
       error = "blabla";
       break;
   }
   if(bla)
   {
       error = "bla";
       break;
   }
   break;

}

Personal tools
General
About This Wiki