Compare strings

Discussion in 'ASP General' started by JW, Oct 6, 2003.

  1. JW

    JW Guest

    Hi,

    I'm trying to see if a certain string matches a predefined string so I've
    tried:
    --------------
    If txtCondition3 = "NO THEFT COVER unless client claim free and occupied
    prems for 3 yrs" Then
    response.write "1st condition"
    Else
    response.write "2nd condition"
    End If
    --------------
    But I'm getting neither response!!!

    Any ideas why that would be?

    Thanks, Jon
     
    JW, Oct 6, 2003
    #1
    1. Advertising

  2. JW

    Ray at Guest

    That's not possible. It's either true or false. There is no inbetween.
    Are you sure these lines of code are executing? Are they nested within
    another if or a sub that you're not calling or something like that?

    Ray at work

    "JW" <jon_webb@#NOSPAM#yahoo.com> wrote in message
    news:blshrj$6h0$...
    > Hi,
    >
    > I'm trying to see if a certain string matches a predefined string so I've
    > tried:
    > --------------
    > If txtCondition3 = "NO THEFT COVER unless client claim free and occupied
    > prems for 3 yrs" Then
    > response.write "1st condition"
    > Else
    > response.write "2nd condition"
    > End If
    > --------------
    > But I'm getting neither response!!!
    >
    > Any ideas why that would be?
    >
    > Thanks, Jon
    >
    >
     
    Ray at, Oct 6, 2003
    #2
    1. Advertising

  3. JW

    Evertjan. Guest

    JW wrote on 06 okt 2003 in microsoft.public.inetserver.asp.general:

    > Hi,
    >
    > I'm trying to see if a certain string matches a predefined string so I've
    > tried:
    > --------------
    > If txtCondition3 = "NO THEFT COVER unless client claim free and occupied
    > prems for 3 yrs" Then
    > response.write "1st condition"
    > Else
    > response.write "2nd condition"
    > End If
    > --------------
    > But I'm getting neither response!!!


    If you have the quoted string in one line it surely works

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 6, 2003
    #3
  4. JW

    JW Guest

    Thanks for the reponse - it had worked fine! Like a &*$%^ I'd misplaced my
    response on the page!!
    Sorry for troubling you
    Jon

    "JW" <jon_webb@#NOSPAM#yahoo.com> wrote in message
    news:blshrj$6h0$...
    > Hi,
    >
    > I'm trying to see if a certain string matches a predefined string so I've
    > tried:
    > --------------
    > If txtCondition3 = "NO THEFT COVER unless client claim free and occupied
    > prems for 3 yrs" Then
    > response.write "1st condition"
    > Else
    > response.write "2nd condition"
    > End If
    > --------------
    > But I'm getting neither response!!!
    >
    > Any ideas why that would be?
    >
    > Thanks, Jon
    >
    >
     
    JW, Oct 6, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Reinemann

    How to compare strings

    Thomas Reinemann, May 27, 2004, in forum: VHDL
    Replies:
    0
    Views:
    637
    Thomas Reinemann
    May 27, 2004
  2. =?Utf-8?B?Y2hhcmxpZXdlc3Q=?=

    Newbie: How to compare strings?

    =?Utf-8?B?Y2hhcmxpZXdlc3Q=?=, Aug 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    379
    Brock Allen
    Aug 16, 2005
  3. Replies:
    0
    Views:
    450
  4. al

    Compare strings

    al, Dec 21, 2003, in forum: C++
    Replies:
    1
    Views:
    534
    Cy Edmunds
    Dec 21, 2003
  5. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    798
    Malcolm
    Jun 24, 2006
Loading...

Share This Page