Why does
if SameText(ListBox1.Items[i],Edit1.Text)=true then
not work? It is case-sensitive (strings have different cases), but must be not. The strings are unicode. It works if the strings have the same cases.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to SysUtils.pas (Delphi-XE), SameText “has the same 8-bit limitations as CompareText“, and in CompareText “the compare operation is based on the 8-bit ordinal value of each character, after converting ‘a’..’z’ to ‘A’..’Z’, and is not affected by the current user locale.”
So it seems that you are trying to compare some characters that are outside the 8 bit range.
Edit: you should try AnsiSameText.