Browse Source

* Moved constant to rtlconsts

git-svn-id: trunk@45521 -
michael 5 years ago
parent
commit
6b79e2c2c3
2 changed files with 4 additions and 3 deletions
  1. 2 2
      packages/rtl-objpas/src/inc/nullable.pp
  2. 2 1
      rtl/objpas/rtlconst.inc

+ 2 - 2
packages/rtl-objpas/src/inc/nullable.pp

@@ -47,7 +47,7 @@ Type
 
 implementation
 
-uses typinfo;
+uses rtlconsts,typinfo;
 
 { TNullable }
 
@@ -59,7 +59,7 @@ end;
 function TNullable.GetValue: T;
 begin
   if not FHasValue then
-    raise EConvertError.CreateFmt('Cannot convert Null to type %s',[PtypeInfo(TypeInfo(T))^.Name]);
+    raise EConvertError.CreateFmt(SErrCannotConvertNullToType,[PtypeInfo(TypeInfo(T))^.Name]);
   Result:=FValue;
 end;
 

+ 2 - 1
rtl/objpas/rtlconst.inc

@@ -309,7 +309,8 @@ ResourceString
   SErrCannotWriteToProperty     = 'Cannot write to property "%s".';
   SErrCannotReadProperty        = 'Cannot read property "%s".';
   SErrNoNameValuePairAt         = 'No name=value pair at position %d.';
-
+  SErrCannotConvertNullToType   = 'Cannot convert Null to type %s';
+  
 { ---------------------------------------------------------------------
     Keysim Names
   ---------------------------------------------------------------------}