Parcourir la source

* remove construct with exception, mantis #26738, patch by Alexander.

git-svn-id: trunk@28687 -
marco il y a 11 ans
Parent
commit
29e5418a4f
1 fichiers modifiés avec 2 ajouts et 14 suppressions
  1. 2 14
      rtl/objpas/sysutils/dati.inc

+ 2 - 14
rtl/objpas/sysutils/dati.inc

@@ -1380,24 +1380,12 @@ end;
 
 function TryStrToDateTime(const S: ShortString; out Value: TDateTime): Boolean;
   begin
-    result:=true;
-    try
-      value:=StrToDateTime(s);
-    except
-      on EConvertError do
-        result:=false
-    end;
+    result := TryStrToDateTime(S, Value, DefaultFormatSettings);
   end;
 
 function TryStrToDateTime(const S: AnsiString; out Value: TDateTime): Boolean;
   begin
-    result:=true;
-    try
-      value:=StrToDateTime(s);
-    except
-      on EConvertError do
-        result:=false
-    end;
+    result := TryStrToDateTime(S, Value, DefaultFormatSettings);
   end;
 
 function TryStrToDateTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;