Page 1 of 1

if <var A> is in <var B> capital letters vs non cap issue

Posted: Thu Jul 30, 2015 5:36 pm
by mrcoollion
Maybe I am doing something wrong but I cannot get the 'if <va A> is in <var B>' distinguish between capital letters and non capital letters.
This also goes for the 'is among the items of' command type.
Any idea's ?

Using livecode 7.06 commercial edition.

Here is some test code

Code: Select all

on mouseUp   
   #Put "P2t2r@H0me" into tocheckstring #correct string
   Put "p2t2r@h0me" into tocheckstring # wrong string , no capitals
   put "qwertyuiopasdfghjklzxcvbnm" into ListA
   put "QWERTYUIOPASDFGHJKLZXCVBNM " into ListB
   put "1234567890" into ListC
   put "!@#$%^&*()-_=+[{]};:'\|,<.>/?" into ListD
   put "correct"into CheckFormat
   put "wrong" into CheckFormatA
   put "wrong" into CheckFormatB
   put "wrong" into CheckFormatC
   put "wrong" into CheckFormatD
   repeat for each character charactertest in tocheckstring
      if  charactertest is in ListA then put "correct" into CheckFormatA
      if  charactertest is in ListB then put "correct" into CheckFormatB
      if  charactertest is in ListC then put "correct" into CheckFormatC
      if  charactertest is in ListD then put "correct" into CheckFormatD
   end repeat
   if CheckFormatA="wrong"or CheckFormatB="wrong" or CheckFormatC="wrong" or CheckFormatD="wrong" then put "wrong"into CheckFormat
   if CheckFormat is "wrong" then answer "The string must contain normal letter with at least one capital letter, one numeral and at least one special character"
   if CheckFormat is "correct" then answer "The string is ok"
end mouseUp
Kind regards,

Paul

Re: if <var A> is in <var B> capital letters vs non cap issu

Posted: Thu Jul 30, 2015 5:58 pm
by Klaus
Hi Paul,

add this line to your script before you check "if xxx contains yyy", that should do the trick:

Code: Select all

  set the casesensitive to TRUE
Best

Klaus

Re: if <var A> is in <var B> capital letters vs non cap issu

Posted: Mon Aug 03, 2015 3:33 pm
by mrcoollion
Thanks... this works.

Regards,

Paul