NPC Code:
if (playerenters||timeout){
setarray MyArray,4; // creates and array of length 8 starts at 0
MyArray[0] = 23; // sets the first entry in the array to 23;
MyArray[1] = 17; // 2nd entry in the array
MyArray[2] = 32;
MyArray[3] = 2;
for (index=0;index<4;index++){
message MyArray[#v(index)] is equal to #v(MyArray[index]);
sleep 1;
}
timeout=1;
}

I always said I was a poor teacher. But here is a script using an array and a for loop together. Maybe it will make sense when you run it.
I believe it shows how you can use a for loop to access the information in an array. I assure you there are much more complex methods of data retrieval using multiple arrays.