I'm no expert here but it sounds like a creating a function with a loop and two local variables might be something to consider. example (psuedo code):
on function "retrieve data"
local variable arrayX = (put the desired x value here)
local variable i = 0
while i < array.height
retrieve the value here at array(array.x,i)
i = i+1
then call the function "retrieve data" where you need it.
Again I'm no expert with little experience with arrays but maybe this helps a bit.