unit RAI2_RAI2;

 { adapter unit - converts RAI2 calls to delphi calls }
 { automatically generated by Pas2RAI2 }

interface

uses RAI2;

  procedure RegisterRAI2Adapter(RAI2Adapter: TRAI2Adapter);

implementation

uses SysUtils;


  { ERAI2Error }

{ constructor Create(AErrCode: integer; AErrPos: integer; AErrName: string; AErrName2: string) }
procedure ERAI2Error_Create(var Value: Variant; Args: TArgs);
begin
  Value := O2V(ERAI2Error.Create(Args.Values[0], Args.Values[1], Args.Values[2], Args.Values[3]));
end;

{  procedure Assign(E: Exception); }
procedure ERAI2Error_Assign(var Value: Variant; Args: TArgs);
begin
  ERAI2Error(Args.Obj).Assign(V2O(Args.Values[0]) as Exception);
end;

{  procedure Clear; }
procedure ERAI2Error_Clear(var Value: Variant; Args: TArgs);
begin
  ERAI2Error(Args.Obj).Clear;
end;

{ property Read ErrCode: integer }
procedure ERAI2Error_Read_ErrCode(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrCode;
end;

{ property Read ErrPos: integer }
procedure ERAI2Error_Read_ErrPos(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrPos;
end;

{ property Read ErrName: string }
procedure ERAI2Error_Read_ErrName(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrName;
end;

{ property Read ErrName2: string }
procedure ERAI2Error_Read_ErrName2(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrName2;
end;

{ property Read ErrUnitName: string }
procedure ERAI2Error_Read_ErrUnitName(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrUnitName;
end;

{ property Read ErrLine: Integer }
procedure ERAI2Error_Read_ErrLine(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).ErrLine;
end;

{ property Read Message1: string }
procedure ERAI2Error_Read_Message1(var Value: Variant; Args: TArgs);
begin
  Value := ERAI2Error(Args.Obj).Message1;
end;


procedure RegisterRAI2Adapter(RAI2Adapter: TRAI2Adapter);
begin
  with RAI2Adapter do
  begin
   { ERAI2Error }
    AddClass('RAI2', ERAI2Error, 'ERAI2Error');
    AddGet(ERAI2Error, 'Create', ERAI2Error_Create, 4, [varInteger, varInteger, varString, varString], varEmpty);
    AddGet(ERAI2Error, 'Assign', ERAI2Error_Assign, 1, [varEmpty], varEmpty);
    AddGet(ERAI2Error, 'Clear', ERAI2Error_Clear, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrCode', ERAI2Error_Read_ErrCode, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrPos', ERAI2Error_Read_ErrPos, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrName', ERAI2Error_Read_ErrName, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrName2', ERAI2Error_Read_ErrName2, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrUnitName', ERAI2Error_Read_ErrUnitName, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'ErrLine', ERAI2Error_Read_ErrLine, 0, [0], varEmpty);
    AddGet(ERAI2Error, 'Message1', ERAI2Error_Read_Message1, 0, [0], varEmpty);
  end;    { with }
end;    { RegisterRAI2Adapter }

end.
