Welcome to WebmasterWorld Guest from 54.145.136.73

Forum Moderators: ocean10000

string testing issues

scripting problem

   
11:15 pm on May 5, 2006 (gmt 0)

5+ Year Member



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?

3:09 am on May 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



select case someValue
case "FL":
'do fl stuff
else
'do all other stuff
end select
5:28 am on May 6, 2006 (gmt 0)

5+ Year Member



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.

10:41 am on May 6, 2006 (gmt 0)

10+ Year Member



Hi,

What about

<%If Not Ucase(userInfo("profile")) = "FL" Then%>
next...
<%End If%>

HTH, AA

5:26 pm on May 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>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?

6:16 pm on May 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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"

1:59 pm on May 8, 2006 (gmt 0)

5+ Year Member



coder,

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?

11:18 pm on May 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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%>

8:10 am on May 10, 2006 (gmt 0)

5+ Year Member



unfortunately the first didn't work but the last one seems to. Thanks!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month