Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/RTL Exceptions    [ Add a report in this area ]  
Report #:  3530   Status: Withdrawn
Exception.CreateRes*() should be deprecated
Project:  Delphi Build #:  4.453
Version:    7.0 Submitted By:   Troy Wolbrink
Report Type:  Suggestion / Enhancement Request Date Reported:  2/13/2003 8:18:06 PM
Severity:    Infrequently encountered problem Last Updated: 5/2/2003 12:58:35 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
resourcestring
    SExampleError = 'This is a sample error.';

begin
  // example #1
  raise Exception.CreateRes(@SExampleError);

  // example #2
  raise Exception.Create(SExampleError);
end;

Both examples do exactly the same thing.  Example 2 is more readable.

---------------------------------------------

Actually the CreateRes* constructors come in two flavors:

{A}    constructor CreateRes(Ident: Integer); overload;
{B}    constructor CreateRes(ResStringRec: PResStringRec); overload;

I'm not debating the use of {A}.  I just think {B} is not needed and should be deprecated.
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments

ACOUSTA Software Engineer at 2/14/2003 1:17:51 AM -
I think that it should be as it is. Every programmer should have the choice of using the constructor in that way he wants. Also it's not a must to declare resources via resourcestring and then you would maybe happy to have the free choice.

Server Response from: ETNACODE01