瀏覽代碼

* EInvalidCast added (from runerror 219)

florian 27 年之前
父節點
當前提交
5e622e60c0
共有 3 個文件被更改,包括 16 次插入7 次删除
  1. 1 1
      rtl/inc/except.inc
  2. 6 2
      rtl/objpas/stre.inc
  3. 9 4
      rtl/objpas/sysutils.pp

+ 1 - 1
rtl/inc/except.inc

@@ -113,7 +113,7 @@ Function Raiseexcept (Obj : TObject; AnAddr : Pointer) : TObject;[Public, Alias
 
 begin
 {$ifdef excdebug}
-  writeln ('In RAiseException');
+  writeln ('In RaiseException');
 {$endif}
   PushExceptObj(Obj,AnAddr);
   If ExceptAddrStack=Nil then

+ 6 - 2
rtl/objpas/stre.inc

@@ -44,11 +44,15 @@ Const
    SInvalidPointer = 'Invalid pointer operation';
    SOutOfMemory = 'Out of memory';
    SRangeError = 'Range check error';
+   SInvalidCast = 'Invalid type cast';
    STooManyOpenFiles = 'Too many open files';
    SUnKnownRunTimeError = 'Unknown Run-Time error : %3.3d';
 {
   $Log$
-  Revision 1.3  1998-10-02 13:57:37  michael
+  Revision 1.4  1998-10-03 15:08:04  florian
+    * EInvalidCast added (from runerror 219)
+
+  Revision 1.3  1998/10/02 13:57:37  michael
   Format error now causes exception
 
   Revision 1.2  1998/10/02 13:00:09  michael
@@ -57,4 +61,4 @@ Const
   Revision 1.1  1998/10/01 16:04:59  michael
   + Initial implementation
 
-}   
+}   

+ 9 - 4
rtl/objpas/sysutils.pp

@@ -86,6 +86,7 @@ interface
        EInvalidPointer  = Class(Exception);
        EOutOfMemory     = Class(Exception);
        EAccessViolation = Class(Exception);
+       EInvalidCast = Class(Exception);
        
        
        { String conversion errors }
@@ -180,7 +181,7 @@ begin
    Writeln ('Exception object ',Obj.ClassName,' is not of class Exception.');
   Halt(217);
 {$else}
-{$endif}  
+{$endif}
 end;
 
 
@@ -220,9 +221,10 @@ begin
   // We don't set abstracterrorhandler, but we do it here. 
   // Unless the use sets another handler we'll get here anyway...
   200 : E:=EDivByZero.Create(SDivByZero);
-  201 : E:=ERangeError.Create(SRangeError);
+  201 : E:=ERangeError.Create(SRangeError);  
   211 : E:=EAbstractError.Create(SAbstractError);
-  216 : E:=EAccessViolation.Create (SAccessViolation);
+  216 : E:=EAccessViolation.Create(SAccessViolation);
+  219 : E:=EInvalidCast.Create(SInvalidCast);
   else
 {$ifdef autoobjpas}
    E:=Exception.CreateFmt (SUnKnownRunTimeError,[Errno]);
@@ -254,7 +256,10 @@ begin
 end.
 {
     $Log$
-    Revision 1.13  1998-10-02 13:00:11  michael
+    Revision 1.14  1998-10-03 15:08:05  florian
+      * EInvalidCast added (from runerror 219)
+
+    Revision 1.13  1998/10/02 13:00:11  michael
     + More RTL error handling
 
     Revision 1.12  1998/10/02 12:17:18  michael