Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 703637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:51:12+00:00 2026-05-14T03:51:12+00:00

I’m using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI

  • 0

I’m using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI JVCL 3.0. Given the code below, I’m having the following problem: only the first exception handling block gets a valid instance of E. The other blocks match properly with the class of the Exception being raised, but E is unassigned (nil).

For example, given the current order of the exception handling blocks when I raise an E1 the block for E1 matches and E is a valid object instance. However, if I try to raise an E2, that block does match, but E is unassigned (nil). If I move the E2 catching block to the top of the ordering and raise an E1, then when the E1 block matches E is is now unassigned. With this new ordering if I raise an E2, E is properly assigned when it wasn’t when the E2 block was not the first block in the ordering. Note I tried this case with a bare-bones project consisting of just a single Delphi form.

Am I doing something really silly here or is something really wrong?

Thanks,
Robert

type
    E1 = class(EAbort)
    end;

    E2 = class(EAbort)
    end;


procedure TForm1.Button1Click(Sender: TObject);
begin
    try
        raise E1.Create('hello');
    except
        On E: E1 do
        begin
            OutputDebugString('E1');
        end;

        On E: E2 do
        begin
            OutputDebugString('E2');
        end;

        On E: Exception do
        begin
            OutputDebugString('E(all)');
        end;
    end; // try()
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:51:13+00:00Added an answer on May 14, 2026 at 3:51 am

    If I am right, the behaviour you are seeing is witnessed when evaluating E under the debugger (this I obtained similar behaviour testing this in the BDS 2006 debugger).

    This is a symbol resolution bug in the debugger but does not appear to affect runtime behaviour.

    If debugging behaviour is important, simply rename your exception handler variables so that the debugger does not have any (potential) ambiguities to have to resolve:

    On E1: E1 do
    begin
        OutputDebugString('E1');
    end;
    
    On E2: E2 do
    begin
        OutputDebugString('E2');
    end;
    
    On Ex: Exception do
    begin
        OutputDebugString('E(all)');
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.