-
-
Save marcosfreitas/af80df6783e151d683ca to your computer and use it in GitHub Desktop.
Esta função em ASP serve para verificar se um determinado valog existe em um array. Retorna false se não encontrar nada ou retorna a posição (i) onde o valor foi encontrado
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Function inArray(byVal value, byVal my_array) | |
Dim i | |
inArray = false | |
For i=0 To Ubound(my_array) | |
If (my_array(i) = value) Then | |
inArray = true | |
Exit Function | |
End If | |
Next | |
End Function | |
ids_ignorados = Array("42","23","20","30","32","24","25","37","39","40","38") | |
find_this = "32" | |
If (inArray(find_this, ids_ignorados)) Then | |
Response.Write findThis & " is in the array" | |
ElseIf (not inArray(find_this, regex_colunas_ignoradas)) then | |
Response.Write findThis & " is not in the array" | |
End If | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment