I am taking
var s:string
begin
s:=editYear.text
and there is the separator.
My solution is:
{$ifdef Lazarus}
lReset := false;
s := '';
sTmp := eJahr.Text;
iMax := length(sTmp);
for i := 1 to iMax do
begin
if sTmp[i] in [#48..#57] then
s := s + sTmp[i]
else
lReset := true;
end;
if lReset then
eJahr.Text := s;
{$Else}
s := eJahr.Text;
{$Endif}
i_Year := eval2IntDef(s, -4001);
if i_Year > -4001 then
yCal.iYear := i_Year;