Bill Henderson
asked on
Classic ASP vb syntax question pt 2
Hi.
On Q_28290100 I saw a number of solutions for checking if a value exists in a comma delimited list, but I was wondering if it possible to check if '1' is contained in the string AND if '2' is NOT contained in the string.
What would that syntax look like in this statement if we were to modify it?
Thanks again
Bill
On Q_28290100 I saw a number of solutions for checking if a value exists in a comma delimited list, but I was wondering if it possible to check if '1' is contained in the string AND if '2' is NOT contained in the string.
What would that syntax look like in this statement if we were to modify it?
instr(Session("UserType"),"1")
Thanks again
Bill
ASKER
But here's the issue - I have about 20 buttons with about 6 possible conditions. Like one button might be for 1, 3, and 7s, and another button is for 1,2 and 7. Another is 2 and 5 only.
Building the array seems like a thorough thing to do, but would lead to a huge amount of additional lines of code, compared with something smaller like the original solution. I mean, am I close with this approach?
Would this work?
I can just try this in a few hours today, but was hoping to go in prepared...
Thanks for your time
Bill
Building the array seems like a thorough thing to do, but would lead to a huge amount of additional lines of code, compared with something smaller like the original solution. I mean, am I close with this approach?
<% if (instr(Session("UserType"),"1") or NOT instr(Session("UserType"),"2") then %>
Would this work?
I can just try this in a few hours today, but was hoping to go in prepared...
Thanks for your time
Bill
ASKER
Oops that would be AND NOT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER
Hi Rainer - I just added a related question to this - Q_28306128 - would really appreciate it if you had a chance to take a look at that.
Thanks!
Bill
Thanks!
Bill
then a separate function makes even more sense:
Open in new window