-
For Loop to search an array
I have a source text on another layer where a user can input values separated by semi-colon:
a = [10; 20; 30; 40]
I need to check this array to see if any value is above my maximum number (“cap”)
However, when I use a for loop expression, it’s only looking at the last number in my array and not considering if any other value is above my cap:
a = thisComp.layer(“Text_Input”).text.sourceText.split(“; “);
l = a.length;
cap = 100;
for (i=0; i<l; i++){
if(a[i] >= cap) “Fail”; else “Pass”
}
I feel like I’m missing something really obvious here.