Browse Source

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

git-svn-id: trunk@28687 -
marco 11 năm trước cách đây
mục cha
commit
29e5418a4f
1 tập tin đã thay đổi với 2 bổ sung14 xóa
  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;