Arrays are indexed by numbers. CurX is just whatever the current number is in the For loop, for the X dimension.
So if we have a single dimension array, for the moment, your array would be:
CurX=0 -> Array(0) -> "triangle"
CurX=1 -> Array(1) -> "circle"
CurX=2 -> Array(2) -> "square"
CurX=3 -> Array(3) -> "rectangle"
"For each X element" is just setting the value of CurX to those numbers for you. If we introduce two dimensions, then we need to start adding the Y index to get at the appropriate data. Y=0 is our name.
CurX=0 -> Array(0,0) -> "triangle"
CurX=1 -> Array(1,0) -> "circle"
CurX=2 -> Array(2,0) -> "square"
CurX=3 -> Array(3,0) -> "rectangle"
Y=1 is our count (assuming some random values for the moment).
CurX=0 -> Array(0,1) -> 3
CurX=1 -> Array(1,1) -> 7
CurX=2 -> Array(2,1) -> 4
CurX=3 -> Array(3,1) -> 0
Does that help any?