if <var A> is in <var B> capital letters vs non cap issue
Posted: Thu Jul 30, 2015 5:36 pm
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
Kind regards,
Paul
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
Paul