Browse Source

* Extended Error methods so that exceptions are raised from the caller's
address instead of the Error method

sg 25 years ago
parent
commit
a4e93f299d
3 changed files with 19 additions and 9 deletions
  1. 7 3
      fcl/inc/bits.inc
  2. 6 3
      fcl/inc/lists.inc
  3. 6 3
      fcl/inc/stringl.inc

+ 7 - 3
fcl/inc/bits.inc

@@ -23,13 +23,13 @@ ResourceString
 Procedure BitsError (Msg : string);
 
 begin
-  Raise EBitsError.Create(Msg);
+  Raise EBitsError.Create(Msg) at get_caller_addr(get_frame);
 end;
 
 Procedure BitsErrorFmt (Msg : string; Args : array of const);
 
 begin
-  Raise EBitsError.CreateFmt(Msg,args);
+  Raise EBitsError.CreateFmt(Msg,args) at get_caller_addr(get_frame);
 end;
 
 procedure TBits.CheckBitIndex (Bit : longint;CurrentSize : Boolean);
@@ -372,7 +372,11 @@ end;
 
 {
   $Log$
-  Revision 1.4  2000-10-15 10:04:39  peter
+  Revision 1.5  2000-11-17 13:39:49  sg
+  * Extended Error methods so that exceptions are raised from the caller's
+    address instead of the Error method
+
+  Revision 1.4  2000/10/15 10:04:39  peter
     + Capitalization of TBits interface fixed; CheckBitIndex now checks for
       size (merged)
 

+ 6 - 3
fcl/inc/lists.inc

@@ -132,8 +132,7 @@ end;
 class procedure TList.Error(const Msg: string; Data: Integer);
 
 begin
-  //!! Find a way to get call  address
-  Raise EListError.CreateFmt(Msg,[Data]);
+  Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
 end;
 
 procedure TList.Exchange(Index1, Index2: Integer);
@@ -400,7 +399,11 @@ end;
 
 {
   $Log$
-  Revision 1.3  2000-09-14 18:39:31  michael
+  Revision 1.4  2000-11-17 13:39:49  sg
+  * Extended Error methods so that exceptions are raised from the caller's
+    address instead of the Error method
+
+  Revision 1.3  2000/09/14 18:39:31  michael
   + Fixed setcapacity
 
   Revision 1.2  2000/07/13 11:32:59  michael

+ 6 - 3
fcl/inc/stringl.inc

@@ -194,8 +194,7 @@ end;
 Procedure TStrings.Error(const Msg: string; Data: Integer);
 
 begin
-  //!! Need to get correct address !!
-  Raise EStringListError.CreateFmt(Msg,[Data]);
+  Raise EStringListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
 end;
 
 
@@ -957,7 +956,11 @@ end;
 
 {
   $Log$
-  Revision 1.3  2000-11-13 15:46:55  marco
+  Revision 1.4  2000-11-17 13:39:49  sg
+  * Extended Error methods so that exceptions are raised from the caller's
+    address instead of the Error method
+
+  Revision 1.3  2000/11/13 15:46:55  marco
    * Unix renamefest for defines.
 
   Revision 1.2  2000/07/13 11:33:01  michael