Hi,
While looking at the code in EditBtn.pas, I noticed some strange statement(may be bug):
Function ParseDate(S : String; Order : TDateOrder; Def: TDateTime) : TDateTime;
Var
P,N1,N2,N3 : Integer;
B : Boolean;
begin
Result:=Def;
P:=Pos(DefaultFormatSettings.DateSeparator,S);
If (P=0) then
Exit;
N1:=StrToIntDef(Copy(S,1,P-1),-1);
If (N1=-1) then Exit;
Delete(S,1,P);
P:=Pos(DefaultFormatSettings.DateSeparator,S);
If (P=0) then
Exit;
N2:=StrToIntDef(Copy(S,1,P-1),-1);
If (N1=0) then Exit;
Delete(S,1,P);
N3:=StrToIntDef(S,-1);
If (N3=-1) then
exit;
Case Order of
doYMD : B:=TryEncodeDate(N1,N2,N3,Result);
doMDY : B:=TryEncodeDate(N3,N1,N2,Result);
doDMY : B:=TryEncodeDate(N3,N2,N1,Result);
else B:=false;
end;
If not B then // Not sure if TryEncodeDate touches Result.
Result:=Def;
end;
This:
N2:=StrToIntDef(Copy(S,1,P-1),-1);
If (N1=0) then Exit;
shouldn't it be:
If(N2=-1) then Exit;
Regards