maxkleiner / maXbox4

code compiler script studio
GNU General Public License v3.0
23 stars 10 forks source link

StrToCharSet #18

Closed maxkleiner closed 2 years ago

maxkleiner commented 4 years ago

use the function to check a set 👍

  ``` or it:= 0 to 9 do 
    if itoa(it)[1] in strtochars('BCE03C310FAEBA451DF2BDEE7B3A0DE2B5ECB8BD') then
      write('found: '+ itoa(it)+' ');
    writeln(CRLF)
  for it:= ord('A') to ord('F') do 
    if chr(it) in strtochars('BCE03C310FAEBA451DF2BDEE7B3A0DE2B5ECB8BD') then
      write('found: '+ chr(it)+'  ')`````
maxkleiner commented 4 years ago

alternatives:

  1. if (ex[i] > 'a') and (ex[i] < 'z') then //in ['a'..'z']
  2. if ex[i] in StrToCharSet(lowercase(LETTERSET)) then include:= include+strtoCharset(ex[i]);
maxkleiner commented 2 years ago

Possible with: function SysCharSetToStr(const C: TSysCharSet): AnsiString; function StrToSysCharSet(const S: AnsiString): TSysCharSet;