Case Sensitivity in comparisons

Results 1 to 2 of 2

Thread: Case Sensitivity in comparisons

  1. #1
    Matt Thrower Guest

    Default Case Sensitivity in comparisons

    Hi,<BR>I was under the impression that since VBscript is case-insensitive, ASP pages written in VBscript ought to be as well, but what I&#039;m currently working on isn&#039;t. I&#039;d like to know what part of my comparison is case sensitive and any ideas on how to fix it. There are currently two suspect comparisons, the first is:<BR><BR>If right(objFile.Name,4) = ".jpg" and left(objFile.Name,Len(arrName(0))) = arrName(0) Then<BR><BR>which compares string against string. The other (and more likely) candidate is:<BR><BR>strTest = "E:Intranetgeneralstaff\" & objSubFolder.Name & "\" & arrName(0) & arrName(1) & ".jpg"<BR>If objFSO.FileExists(strTest) = true Then<BR><BR>However, if I change &#039;staff&#039; to &#039;STAFF&#039; it doesn&#039;t seem to affect it. Is it the FileExists method that&#039;s case sensitive and if so, what can I do about it?<BR>

  2. #2
    strands Guest

    Default RE: Case Sensitivity in comparisons

    convert both of the two strings you want to compare to uppercase (using the function Ucase) before hand

Posting Permissions

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