Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
string testing issues scripting problem Starbuck
I am trying to query a field from an open DB. The following works fine, but it works in the positive response. <% if userInfo("profile")=FL then %> next script <% end if %>
I want to test for NOT equaling a specific value. I have several values to test, absent of testing each one, which I don't want to do, so I just really want to have it test for the one I do want left out, & pass the rest to the next line of the script, rejecting the tested positive one to the end.
How would I test for that?
select case someValue case "FL": 'do fl stuff else 'do all other stuff end select Starbuck
guess I don't understand. All data is upper case, not sure I see the syntax, how that get's what I want. It seems identical to what I already stated.
I want to test for it NOT being true.
<%If Not Ucase(userInfo("profile")) = "FL" Then%>
next... <%End If%>
>>guess I don't understand. All data is upper case, not sure I see the syntax
select case UCase(someValue)
case "FL": 'do fl stuff else 'do all other stuff end select
'not equal to' will force the 'case else' to execute; isn't that what you wanted?
You can try:
<% if userInfo("profile")=FL then %>
'do nothing <% else %> next script <% end if %>
If "profile" = fl, it does nothing, if it is different, it will do "next script"
No all data is upper case, I am not testing for case, but for value. I want it to execute the next line if it is NOT FL or fl & if it is FL or fl then it goes to end.
That is what I want. I am going to try the other exapmle posted, it seems closer to what I am looking for.
does it look right to everyone else?
Arno_Adams' solution sounds like it's what you want, without the case checking:
If Not userInfo("profile") = "FL" Then%> next... <% End If%>
Another way to do the same thing is:
If userInfo("profile") <> "FL" Then%> next... <% End If%> Starbuck
unfortunately the first didn't work but the last one seems to. Thanks!