This content has been marked as final.
Show 3 replies
-
1. Re: For Loop not acting correctly...
Magus069 Aug 19, 2014 8:20 AM (in response to Magus069)I fixed it using a var for the count....
var ResourceCount = frmResourceReq.instanceManager.count;
for (var c = 0; c < ResourceCount ; c++){} //is working....
-
2. Re: Re: For Loop not acting correctly...
radzmar Aug 19, 2014 10:09 AM (in response to Magus069)Hi,
to avoid that the loops condition is unnecessarily calculated again for every iteration it's recommended to save the condition in a variable first.
for (var c = 0, n = _frmResourceReq.count; c < n; c += 1) { //code to execute }As the instance count of iteration frmResourceReq may change already while the loop runs it can end with unexpected results.
-
3. Re: Re: For Loop not acting correctly...
Magus069 Aug 19, 2014 10:34 AM (in response to radzmar)That is what I thought but thanks for clearing this out!


