Jump to content
Sign in to follow this  
bloodxgusher

Simple Script

Recommended Posts

So i came across this script and it just turned my brain to mush.... (Too many symbols to COMPUTE !!!)

So someone want to explain what it means in english :) Lol. Thanks


for [{_i=0}, {_i < (count _arr)}, {_i=_i+1}]

Share this post


Link to post
Share on other sites

It's a FOR loop.

Begins _i at 0 as a counter.

Will run whatever is inside the loop as long as _i is less than the count of _arr variable (not sure what it is, as we do not see the whole script here). After each successful run of the loop, it will +1 the _i variable.

More Info: http://community.bistudio.com/wiki/Control_Structures#for-Loop

Share this post


Link to post
Share on other sites

It's a loop that assumes you're feeding it an array called _arr.

The loop will start with the value of _i being 0 (the first section, {_i=0}). It will loop until the value of _i is less than the count of the number of values in the array _arr (second section, {_i < (count _arr)}) and each time it loops it will increase the value of _i by 1 (last section ({_i=_i+1}).

So if _arr = ["bob","mary","Stefania"]; then running that code will loop three times, with _i being equal to 0, 1 and 2 each loop through, respectively.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×