Skip to content

Instantly share code, notes, and snippets.

@marcosfreitas
Forked from gwobcke/checkIfInArray.asp
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save marcosfreitas/af80df6783e151d683ca to your computer and use it in GitHub Desktop.

Select an option

Save marcosfreitas/af80df6783e151d683ca to your computer and use it in GitHub Desktop.

Revisions

  1. marcosfreitas revised this gist Apr 14, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions check_if_has_a_string_in_array.asp
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    <%
    Function inArray(byVal value, byVal my_array)
    Dim i
    inArray = false
  2. marcosfreitas renamed this gist Apr 14, 2015. 1 changed file with 0 additions and 0 deletions.
  3. marcosfreitas revised this gist Apr 2, 2015. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions check_if_string_in_array.asp
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,21 @@
    <%
    Function inArray(value, my_array)
    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 = i
    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 = "38"
    find_this = "32"
    If (inArray(find_this, ids_ignorados) ) Then
    If (inArray(find_this, ids_ignorados)) Then
    Response.Write findThis & " is in the array"
    ElseIf (inArray(find_this, regex_colunas_ignoradas)) = false then
    ElseIf (not inArray(find_this, regex_colunas_ignoradas)) then
    Response.Write findThis & " is not in the array"
    Else
    Response.Write "I don't know nothing"
    End If
    %>
  4. marcosfreitas revised this gist Apr 1, 2015. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions check_if_string_in_array.asp
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,23 @@
    <%
    Function inArray(_string, _array)
    Dim in_array, i
    in_array = false
    For i=0 To Ubound(_array)
    If (_array(i) = _string) Then
    in_array = true
    Exit Function
    Function inArray(value, my_array)
    Dim i
    inArray = false
    For i=0 To Ubound(my_array)
    If (my_array(i) = value) Then
    inArray = i
    Exit Function
    End If
    Next
    End Function
    findThis = "Apple"
    fruits = Array("Banana","Apple","Orange")
    ids_ignorados = Array("42","23","20","30","32","24","25","37","39","40","38")
    find_this = "38"
    If in_array(findThis, fruits) Then
    If (inArray(find_this, ids_ignorados) ) Then
    Response.Write findThis & " is in the array"
    Else
    ElseIf (inArray(find_this, regex_colunas_ignoradas)) = false then
    Response.Write findThis & " is not in the array"
    Else
    Response.Write "I don't know nothing"
    End If
    %>
  5. marcosfreitas renamed this gist Apr 1, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions checkIfInArray.asp → check_if_string_in_array.asp
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    <%
    Function in_array(element, arr)
    in_array = False
    For i=0 To Ubound(arr)
    If Trim(arr(i)) = Trim(element) Then
    in_array = True
    Function inArray(_string, _array)
    Dim in_array, i
    in_array = false
    For i=0 To Ubound(_array)
    If (_array(i) = _string) Then
    in_array = true
    Exit Function
    End If
    Next
  6. Graham Wobcke created this gist Jun 24, 2011.
    20 changes: 20 additions & 0 deletions checkIfInArray.asp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <%
    Function in_array(element, arr)
    in_array = False
    For i=0 To Ubound(arr)
    If Trim(arr(i)) = Trim(element) Then
    in_array = True
    Exit Function
    End If
    Next
    End Function
    findThis = "Apple"
    fruits = Array("Banana","Apple","Orange")
    If in_array(findThis, fruits) Then
    Response.Write findThis & " is in the array"
    Else
    Response.Write findThis & " is not in the array"
    End If
    %>