Hello!
I have a tricky little problem. I want to retrieve the index of a current occurence inside an array. I use this code:
This code ALWAYS returns 0 even if the array contains 10 indexes... I read somewhere in this thread that Array.IndexOf returns the very first occurence of a value inside the array. Does that mean that Array.IndexOf always should return 0? Since all fields in the array are unique it should return 9 if Request.QueryString("i") equals to a value in the 9th position of the array, right? Or am I thinking wrong?
If I am thinking wrong, how should I retrieve the index of a current request from the array?
// Kristofer
I have a tricky little problem. I want to retrieve the index of a current occurence inside an array. I use this code:
VB.NET:
Array.IndexOf(myArray, Request.QueryString("i"))
This code ALWAYS returns 0 even if the array contains 10 indexes... I read somewhere in this thread that Array.IndexOf returns the very first occurence of a value inside the array. Does that mean that Array.IndexOf always should return 0? Since all fields in the array are unique it should return 9 if Request.QueryString("i") equals to a value in the 9th position of the array, right? Or am I thinking wrong?
If I am thinking wrong, how should I retrieve the index of a current request from the array?
// Kristofer