Welcome to WebmasterWorld Guest from 54.196.117.47

Forum Moderators: ocean10000

Message Too Old, No Replies

string testing issues

scripting problem

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

New User

10+ Year Member

joined:Apr 12, 2006
posts:24
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2003
posts:1184
votes: 0


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

New User

10+ Year Member

joined:Apr 12, 2006
posts:24
votes: 0


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)

Junior Member

10+ Year Member

joined:Dec 7, 2004
posts:130
votes: 0


Hi,

What about

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

HTH, AA

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2003
posts:1184
votes: 0


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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 12, 2002
posts:857
votes: 0


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)

New User

10+ Year Member

joined:Apr 12, 2006
posts:24
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 12, 2002
posts:1482
votes: 0


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)

New User

10+ Year Member

joined:Apr 12, 2006
posts:24
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members