I'm trying to check if the value of a variable is in an array. Having some difficulty. My array is stored it the global.asa.
Dim aTree(5)
aTree(0) = "a"
aTree(1) = "b"
aTree(2) = "c"
aTree(3) = "d"
aTree(4) = "e"
aTree(5) = "f"
Application("aTree") = aTree
The variable I'm trying to check stores some html content
<% If tree = "a" Then %>
<div class="card bg_white">
<h1 class="bold small-caps tbrown">my content</h1>
</div>
<% End If %>
I'm trying to do the check this way
<% tree = Request("tree")
if in_array(tree, aTree) then %>
You've found it
<% End if %>
I've got this clunky version that works
(tree <> "" and tree <> "a" and tree <> "b" and tree <> "c" and tree <> "d" and tree <> "e" and tree <> "f")
But I'd like a more elegant way of doing it with an array.
Little help. Thanks.