|  |  Login Products  Sales  Support  Downloads  About | 
| Home » Technical Support » Elevate Web Builder Technical Support » Product Manuals » Elevate Web Builder 3 Manual » Language Reference » Exception Handling | 
 Exception Handling
 Exception HandlingException = class(TObject)
   public
      property Message: String read;
      property UnitName: String read;
      property StackTrace: String read;
   end;raise <Exception Class Instance>;
function AddValues(A,B: Integer): Integer;
begin
   if (A < 0) then
      raise Exception.Create('First parameter '+IntToStr(A)+' cannot be negative');
   if (B < 0) then
      raise Exception.Create('Second parameter '+IntToStr(A)+' cannot be negative');
   Result:=(A+B);
end;try <Statements> except <Exception-handling statements> end;
on <ExceptionInstanceVariable>: <ExceptionClass> do <Statements> on <ExceptionClass> do <Statements>
begin
  try
     // Statements that raise exception
  except
     on E: Exception do
        LogOutput(E.Message);
  end;
end; Re-raising exceptions can only be done from within the except portion of a try..except code block, and an attempt to do so outside of this context will cause a compiler error.
 Re-raising exceptions can only be done from within the except portion of a try..except code block, and an attempt to do so outside of this context will cause a compiler error.  begin
  try
     // Statements that raise exception
  except
     on E: Exception do
        LogOutput(E.Message);
     raise;
  end;
end;try <Statements> finally <Statements> end;
procedure TMyClass.Execute;
begin
   FExecuting:=True;
   try
      // Executing
   finally
      FExecuting:=False;
   end;
end; A try..finally code block also applies to the exit statement.  If an exit statement is specified inside of a try..finally code block, the finally portion of the code block will be executed before the function or procedure actually exits.
 A try..finally code block also applies to the exit statement.  If an exit statement is specified inside of a try..finally code block, the finally portion of the code block will be executed before the function or procedure actually exits. More Support Options
 More Support Options| This web page was last updated on Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy  Site Map © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ?  E-mail us at info@elevatesoft.com | 
