* Use StrToXXXDef functions for readXXX()

git-svn-id: trunk@7380 -
This commit is contained in:
michael 2007-05-17 16:17:28 +00:00
parent cc9bc424e4
commit fd096ef0f8

View File

@ -387,59 +387,27 @@ begin
end;
function TCustomIniFile.ReadDate(const Section, Ident: string; Default: TDateTime): TDateTime;
var
s: string;
begin
Result := Default;
s := ReadString(Section, Ident, '');
if s > '' then try
Result := StrToDate(s);
except
on EConvertError do
else raise;
end;
Result := StrToDateDef(ReadString(Section, Ident, ''),Default);
end;
function TCustomIniFile.ReadDateTime(const Section, Ident: string; Default: TDateTime): TDateTime;
var
s: string;
begin
Result := Default;
s := ReadString(Section, Ident, '');
if s > '' then try
Result := StrToDateTime(s);
except
on EConvertError do
else raise;
end;
Result := StrToDateTimeDef(ReadString(Section, Ident, ''),Default);
end;
function TCustomIniFile.ReadFloat(const Section, Ident: string; Default: Double): Double;
var
s: string;
begin
Result := Default;
s := ReadString(Section, Ident, '');
if s > '' then try
Result := StrToFloat(s);
except
on EConvertError do
else raise;
end;
Result:=StrToFloatDef(ReadString(Section, Ident, ''),Default);
end;
function TCustomIniFile.ReadTime(const Section, Ident: string; Default: TDateTime): TDateTime;
var
s: string;
begin
Result := Default;
s := ReadString(Section, Ident, '');
if s > '' then try
Result := StrToTime(s);
except
on EConvertError do
else raise;
end;
Result := StrToTimeDef(ReadString(Section, Ident, ''),Default);
end;
procedure TCustomIniFile.WriteDate(const Section, Ident: string; Value: TDateTime);