tags:

views:

8

answers:

1

hi,

This is my array

<%
Dim myFixedArray
myFixedArray(0) = "Albert Einstein"
myFixedArray(1) = "Mother Teresa"
myFixedArray(2) = "Bill Gates"
myFixedArray(3) = "Martin Luther King Jr."
%>

Now i using to get value is

<%
For i=0 to 3
response.write myArray(i) & "<br>" 
Next 
%>

I need to take "Bill Gates" array Number

I need resut is "2"

How find result with out loop?

A: 

How about this?

<% 
For i=0 to 3 
If myArray(i) = "Bill Gates" Then
 mynumber = i (or return i)
End If
Next  
%> 
Bhaskar
i wand to avoid for loop, some thing direct, like sql query " where myarray ='Bill Gates'"
Alex
I dont think you will be able to do that in ASP, what you want looks like LINQ and is only available in .NET.
Bhaskar