YENGbreak

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Add into category)
m (Line number clarification)
 
(4 intermediate revisions by one user not shown)
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 )
 +
Make sure to add yoptions; to the second line of the script, usually line number 1 starting from 0.
 +
<source lang="lsl">
 +
string error = "";
  
string error = "";
+
while(true)
while(true)
+
{
{
+
    if(blabla)
  if(blabla)
+
    {
  {
+
        error = "blabla";
    error = "blabla";
+
        break;
    break;
+
    }
  }
+
    if(bla)
  if(bla)
+
    {
  {
+
        error = "bla";
    error = "bla";
+
        break;
    break;
+
    }
  }
+
    break;
  break;
+
}
}
+
</source >
  
 
[[Category:Scripts]]
 
[[Category:Scripts]]

Latest revision as of 14:03, 16 March 2021

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

Make sure to add yoptions; to the second line of the script, usually line number 1 starting from 0.
string error = "";
 
while(true)
{
    if(blabla)
    {
        error = "blabla";
        break;
    }
    if(bla)
    {
        error = "bla";
        break;
    }
    break;
}
Personal tools
General
About This Wiki