homepage Welcome to WebmasterWorld Guest from 54.167.238.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
string testing issues
scripting problem
Starbuck




msg:942748
 11:15 pm on May 5, 2006 (gmt 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?

 

Easy_Coder




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

select case someValue
case "FL":
'do fl stuff
else
'do all other stuff
end select

Starbuck




msg:942750
 5:28 am on May 6, 2006 (gmt 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.

Arno_Adams




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

Hi,

What about

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

HTH, AA

Easy_Coder




msg:942752
 5:26 pm on May 7, 2006 (gmt 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?

defanjos




msg:942753
 6:16 pm on May 7, 2006 (gmt 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"

Starbuck




msg:942754
 1:59 pm on May 8, 2006 (gmt 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?

mattglet




msg:942755
 11:18 pm on May 9, 2006 (gmt 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%>

Starbuck




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved