CharInSet doesn't work with non English letters?

前端 未结 5 783
北荒
北荒 2021-02-07 08:32

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.T         


        
5条回答
  •  天命终不由人
    2021-02-07 09:17

    In addition.

    sets are limited to ordinal values of 256 elements. So AnsiChar fits and (Unicode)Char does not fit. You can use CharInSet to port pre unicode versions of Delphi to the unicode versions. Because of the set limitation, sets are not extremely usefull anymore with Chars.

    The reason behind this, is that sets are implemented as bitmasks. You are free to implement your own version of a set. For example:

    type
      TSet = class 
      public
        procedure Add(const AElem: T);
        function InSet(const AElem: T): Boolean;
      end;
    

提交回复
热议问题