How to raise exceptions in Delphi?

delphi, exception

Solution

The exception class "Exception" is declared in the unit SysUtils. So you must add "SysUtils" to your uses-clause.

uses
  SysUtils;

procedure RaiseMyException;
begin
  raise Exception.Create('Hallo World!');
end;

Problem

I'm asking for Delphi native, not Prism(net). This is my code: ``` raise Exception.Create('some test'); ``` Undeclared identifier "Exception". Where's the problem, how do I throw/raise exceptions?

Original source