makis_best Well-Known Member Licensed User Longtime User Jul 10, 2019 #1 Hi I try to compare a string with the content of one EditText But the code refuse to continuous inside If / End If The result of the Log is correct as you can see below. [email protected] = [email protected] Click to expand... Why? Code: Copy Dim EmailTxt As EditText Dim Local_Email As String Log(EmailTxt.Text & " = " & Local_Email) If EmailTxt.Text = Local_Email Then Wait For (CallSub(Me, "ChangePass")) Complete (Result As Boolean) ........ End If
Hi I try to compare a string with the content of one EditText But the code refuse to continuous inside If / End If The result of the Log is correct as you can see below. [email protected] = [email protected] Click to expand... Why? Code: Copy Dim EmailTxt As EditText Dim Local_Email As String Log(EmailTxt.Text & " = " & Local_Email) If EmailTxt.Text = Local_Email Then Wait For (CallSub(Me, "ChangePass")) Complete (Result As Boolean) ........ End If
makis_best Well-Known Member Licensed User Longtime User Jul 12, 2019 #41 I don't understand why .CompareTo was working and "=" doesn't. The test show that it was a difference between strings.... the normal will be .CompareTo and "=" not to work. Upvote 0
I don't understand why .CompareTo was working and "=" doesn't. The test show that it was a difference between strings.... the normal will be .CompareTo and "=" not to work.
agraham Expert Licensed User Longtime User Jul 12, 2019 #42 'CompareTo' and 'equals' ('=') are not the same, although in most cases the result will be the same. 'equals' checks that two strings are the same length and have identical characters in each character position. 'CompareTo' compares two strings lexicographically and returns 0 if they would both have the same position in a sorted list. If you do find a case where 'CompareTo' returns 0 but 'equals' False then you would need to examine the actual Java code for 'CompareTo' to see why they are lexicographically identical. If you do have a concrete example of lexicographical equivalence but not of strict equality then perhaps we could have a poke around and find out why. Upvote 0
'CompareTo' and 'equals' ('=') are not the same, although in most cases the result will be the same. 'equals' checks that two strings are the same length and have identical characters in each character position. 'CompareTo' compares two strings lexicographically and returns 0 if they would both have the same position in a sorted list. If you do find a case where 'CompareTo' returns 0 but 'equals' False then you would need to examine the actual Java code for 'CompareTo' to see why they are lexicographically identical. If you do have a concrete example of lexicographical equivalence but not of strict equality then perhaps we could have a poke around and find out why.
E emexes Expert Licensed User Longtime User Jul 12, 2019 #43 agraham said: a concrete example of lexicographical equivalence but not of strict equality Click to expand... That is a clear and well-worded description of our goal. Thank you. Upvote 0
agraham said: a concrete example of lexicographical equivalence but not of strict equality Click to expand... That is a clear and well-worded description of our goal. Thank you.
agraham Expert Licensed User Longtime User Jul 12, 2019 #44 emexes said: That is a clear and well-worded description Click to expand... Thank you. I like to think that it is one thing that I am quite good at doing. Upvote 0
emexes said: That is a clear and well-worded description Click to expand... Thank you. I like to think that it is one thing that I am quite good at doing.