In the function I have, CU: = ['A' .. 'Z'];

Question: How to correctly connect Edit to - CU: = Form1.Edit1.Text . If I write like this, I get an error in the form: E2010 Incompatible types: 'TSysCharSet' and 'TCaption'

I understand that the error is petty, but something is stuck ...

function IsGood(AInpStr: String; AMinLen, AMaxLen: Integer; AAlowOnlyLetters: Boolean = True): Boolean; var i: Integer; a: Boolean; Len: Integer; CU, CL: TSysCharSet; begin Result := False; Len := Length(AInpStr); /// ///// Вот тут нужно заменить /// ///// то есть (CU := Form1.Edit1.Text) CU := ['A' .. 'Z']; if AAlowOnlyLetters then begin for i := 1 to Len do begin a := CharInSet(AInpStr[i], CU); .. .. .. .. .. .. .. .. .. .. .. . 
  • one
    I think it would be easier to write if AInpStr[i]>='A' and AInpStr[i]>='Z' or something like that. - nick_n_a 2:17
  • @nick_n_a, I am satisfied with the function, I just can not understand how to edit it correctly to set the parameters of the letters in it. - Tatiana

1 answer 1

 CU := []; for i := 1 to Length(Form1.Edit1.Text) do begin Include(CU, Form1.Edit1.Text[i]); end;