If/Then question

Results 1 to 5 of 5

Thread: If/Then question

  1. #1
    The guy at the keyboard Guest

    Default If/Then question

    It seems like there should be an easier way to do this, but I can&#039;t find one anywhere. I would still like to use an If/Then, and not a Case.<BR><BR>If strFolderBaseName&#060;&#062;"RECYCLER" and strFolderBaseName&#060;&#062;"TempASP" Then<BR><BR>It seems like this should work, but it doesn&#039;t<BR><BR>If strFolderBaseName&#060;&#062;"RECYCLER" or "TempASP" Then

  2. #2
    LeeAnnie Guest

    Default RE: If/Then question

    Assuming that the two conditions that you are trying to meet are:<BR>1. strFolderBaseName&#060;&#062;"RECYCLER" <BR>2. strFolderBaseName&#060;&#062;"TempASP" <BR><BR>If that is the case, then your first if/then clause should work:<BR>If strFolderBaseName&#060;&#062;"RECYCLER" and strFolderBaseName&#060;&#062;"TempASP" Then<BR><BR><BR>If it doesn&#039;t, then try doing a response.write on strFolderBaseName to see what it really is. Also, keep in mind that you may be dealing with "hidden" spaces. Also, if you feel that doing a select case is in order for any reason, testing for strings is case sensitive; i.e. case "My String" would not be executed if the string is really "my string"...<BR><BR>HTH

  3. #3
    Join Date
    Dec 1969

    Default RE: If/Then question

    The first option you posted should work fine. What is the problem you have got? <BR><BR>Is it just that your don&#039;t like having to type the extra code?<BR><BR>Sadly, there is no way around it. We all have to likve with it.

  4. #4
    The guy at the keyboard Guest

    Default RE: If/Then question

    Yes, the first option does work, however because of the nature of the program I am forseeing this particular If/Then becoming ridiculously long. <BR><BR>I could use:<BR><BR>Select Case strFolderBaseName<BR> Case "RECYCLER", "TempASP", etc...<BR><BR>However, it doesn&#039;t really read as well in this particular instance.<BR><BR>Thanks, That clears things up for me. I was wondering if I was missing something.

  5. #5
    LeeAnnie Guest

    Default I see... try this

    &#060;%<BR>str = "5"<BR><BR>select case str<BR>case "1"<BR> response.write("1")<BR>case "2", "3", "4", "5"<BR> response.write(str)<BR>case else<BR> response.write("NO MATCH")<BR>end select<BR>%&#062;<BR><BR><BR>This should help you out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts