code stuck when `global` is added <p>I have weird problem-</p> <p>I have this function</p> <pre><code>function doSomething(par1, par2) global str; // more code on remark.. // im using str here end </code></pre> <p>this function located inside nested while</p> <pre><code>function mainFunction global str; //im using str here while (i&lt;500) while (j&lt;500) doSomething(val1, val2); // some variables j = j+1; end j=1 i = i+1; end end </code></pre> <p>when I ran the code, it get stuck (even that the whole code inside that function is remarked and only the <code>global str</code> is left). but when I remove the <code>global str</code> (empty function), only within the <code>doSomething</code> function, the code gets to the end and finishes correctly.</p> <p><code>str</code> is not complex database, its just regular string..</p> <p>I don't quite know why it happens, or maybe im doing something wrong.</p>