Question: some simple for loops

hi I'm new to maple and I want it t perform some filtering

I want it to select a nummber in array within given condiitions

> t := [1, 4, 9];


> for i from 1 to 3 do if t[i]>2 and t[i]<t[i+1] then  s:=t[i] else s:=t[i]+7end ;
print(`output redirected...`); # input placeholder
Error, unterminated loop
Typesetting:-mambiguous(for i from 1 to 3 do  if t(i)gt2  then s

  Assignt(i) else sAssignt(i) + 7 end if,

  Typesetting:-merror("unterminated loop"))

I just want it to select one number from na array


another thing would be if I have a table how would a loop look like if I want it to chose a number from one collum and print entire row?

Please Wait...