Asp classic 是否可以从带有“value”的数组中获取值;姓名;?
这是我的阵列Asp classic 是否可以从带有“value”的数组中获取值;姓名;?,asp-classic,Asp Classic,这是我的阵列 <% Dim myFixedArray myFixedArray(0) = "Albert Einstein" myFixedArray(1) = "Mother Teresa" myFixedArray(2) = "Bill Gates" myFixedArray(3) = "Martin Luther King Jr." %> 现在我用来获取值的是 <% For i=0 to 3 response.write myArray(i) & "<
<%
Dim myFixedArray
myFixedArray(0) = "Albert Einstein"
myFixedArray(1) = "Mother Teresa"
myFixedArray(2) = "Bill Gates"
myFixedArray(3) = "Martin Luther King Jr."
%>
现在我用来获取值的是
<%
For i=0 to 3
response.write myArray(i) & "<br>"
Next
%>
我需要取“比尔·盖茨”的数组号
我需要的结果是“2”
如何在没有外循环的情况下找到结果?这个怎么样
<%
For i=0 to 3
If myArray(i) = "Bill Gates" Then
mynumber = i (or return i)
End If
Next
%>
我想避免for循环,一些直接的东西,比如sql查询“where myarray='Bill Gates'”我认为在ASP中你无法做到这一点,你想要的东西看起来像LINQ,并且只在.NET中可用。