I'll try to explain: If you have a list/array of items you can loop through its elements either by starting with the first index and go on until you reach a max. index, e.g. simply an array of numbersJuutis wrote:Could you explain a little what this command does and how to use it? I read about it in the Simkin docs but couldn't quite understand it. The example they have doesn't really help...Graywolf wrote:Those "for each in" commands are very convenient.
Code: Select all
for itemindex=0 to 10
{
// you may use 'itemindex' to access an element in your itemlist
itemlist[itemindex] = itemlist[itemindex] + 1;
}
Code: Select all
for each item in itemlist
{
// 'item' is an element of your itemlist
item = item + 1;
}