This is probably the second most common statement to use. It is helpful when working with fields that contain multiple values or when working with multiple issues (just for an example).
Example 1 - Finite number of loops
Use this method when you are not looping through an array of values but some finite number.for(int x = 1; x <= 10; x+=1) {
runnerLog(x);
}
Example 2 - Looping through an array
Use this method when looping through arrays and you don't need to know the index position.string [] fruit = "Apple|Apricot|Avocado|Banana|Blackberry|Blueberry|Cherry|Coconut";
for(string f in fruit) {
runnerLog(f);
}
Example 3 - Looping through an array with index
Sometimes you need to know what number (index) you are on while looping through an array.fruit = "Cranberry|Grape|Grapefruit|Kiwifruit|Lemon|Lime|Mango|Orange";
for(int x = 0; x < size(fruit); x++) {
runnerLog(fruit[x]);
}
In those cases you would use this method.