⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 absexcept.pas

📁 Absolute Database 是来替代BDE[Borland数据库引擎]的用于Delphi 和 C++ Builder 开发用的数据库引擎. 它小巧, 高速, 健壮, 易于使用. 它能直接编译进
💻 PAS
字号:
{$I ABSVer.inc}

unit ABSExcept;

interface

uses SysUtils, Classes, ABSConst;

type


////////////////////////////////////////////////////////////////////////////////
//
// EABSException
//
////////////////////////////////////////////////////////////////////////////////


  EABSException = class( Exception )
  public
    NativeError: Integer;
    constructor Create(NativeErrorCode: Integer; ErrorMsg: String); overload;
    constructor Create(NativeErrorCode: Integer; ErrorMsg: String; const Args: array of const); overload;

  end; // EABSException

implementation


//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
constructor EABSException.Create(NativeErrorCode: Integer; ErrorMsg: String);
var
  ErMessage: string;
begin
  NativeError := NativeErrorCode;
  ErMessage := ErrorMsg;
  ErMessage := ErMessage + ' - Native error: '+ Format('%.5d',[NativeErrorCode]);
  inherited Create(ErMessage);
end; // Create


//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
constructor EABSException.Create(NativeErrorCode: Integer; ErrorMsg: String; const Args: array of const);
var
  ErMessage: string;
begin
  NativeError := NativeErrorCode;
  try
    ErMessage := Format(ErrorMsg, Args);
  except
    ErMessage := ErrorMsg + ' Arguments are invalid!';
  end;
  ErMessage := ErMessage + ' - Native error: ' + Format('%5d',[NativeErrorCode]);
  inherited Create(ErMessage);
end; // Create


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -