I have updated an application from Delphi 2007 to Delphi 2010, everything went fine, except one statement that compiled fine but not working which is:
If Edit1.Text[1] in ['S','س'] then
ShowMessage('Found')
else
ShowMessage('Not Found')
However, I knew that in will not, so I changed to CharInSet
If CharinSet(Edit1.Text[1],['S','س']) then
ShowMessage('Found')
else
ShowMessage('Not Found')
but it never worked when the string is س
, but always work with S
, even I cast the edt1.Text1 with AnsiChar it always not work Arabic letters.
Am doing anything wrong, or it's not the way CharInSet
works?, or that's a bug in CharinSet
?
UPDATE:
My Great friend Issam Ali has suggested another solution which's worked fine as it :
If CharinSet(AnsiString(edt1.Text)[1],['S','س']) then