2 Replies Latest reply on Jun 11, 2007 12:55 PM by Newsgroup_User

    Still need help with case sensitive strings


      Hello guy! Sorry to trouble you with the same problem again, but i still need help!
      "I am trying to create a scrypt that will compare a String with an editable text that the user should type to match that String. I was able to do that, but the problem is that is not case sensitive, even with the adobe help telling me that strings are case sensitive. Do you guys know how to make that comparison match only if all the field has the right upper and lower case letters?
      on exitframe

      if field "t:texto1" = "Residencial Serra Verde"then
      go to next
      end if

      |----> thats the one Im using!"

      There were 2 replys but both of them didnt work, and the second one even made the director crash, corrupting even previously files that had nothing to do with the initial problem..

      first solution given --

      If you put each item that you are comparing into a list, it magically
      makes it case sensitive. Just put list brackets around each item.

      on exitframe

      if [field "t:texto1"] = ["Residencial Serra Verde"] then
      go to next
      end if


      Second solution given--

      The = operator is not case-sensitive when used on strings, but the < and > operators are case-sensitive.

      So another way to do this is to check if the string is neither greater than nor less than the target string:

      vExpected = "Residencial Serra Verde"
      vInput = field "t:texto 1"
      if vExpected < vInput then
      -- ignore
      else if vExpected > vInput then
      -- ignore
      -- vExpected is a case-sensitive match for vInput
      go next
      end if

      So any new solutions??

      Thanks in advance!!

      joao rsm