var s2:string; i:integer; begin for i:=1 to 17 do begin s2:=copy(trim(edit1.Text),i,1); if not (s2 in ['0'..'9']) then begin end; end; end; 出现s2与['0'..'9']类型不匹配错误,该怎么做,请指教,谢谢!
----------------------------------------------
-
if (Length(s2) > 0 ) and (not (s2[1] in ['0'..'9'])) then
其实应该这样写 var s: string; i: Integer; begin s := Trim(Edit1.Text); for i := 1 to Length(s) do if not (s[i] in ['0'..'9']) then begin end; end;
----------------------------------------------