vec2 s[5];
s[1] = vec2(0.0, 0.1);
s[2] = vec2(0.5, 0.8);
int dist = 0;
dist++;
float tst = s[dist].x;

The purpose of using an array in my case, is to compute the index and get the contents of that index. If I have to use a constant, how am I going to compute the index? (by the way, using textures as input is not efficient in my case).
See OpenGL ES Shading Language 1.00 Specification - Appendix A - Indexing of Arrays, Vectors and Matrices:
Therefore, the index of an array can also be the control variable of a for loop:
It should be mentioned that this restriction applies to OpenGL ES Shading Language 1.00 (WebGL 1.0), but not to OpenGL ES Shading Language 3.00 (WebGL 2.0).
See OpenGL ES Shading Language 3.00 Specification - 12.30 Dynamic Indexing: