ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/FBClientAPI.pas
(Generate patch)

Comparing ibx/branches/udr/client/FBClientAPI.pas (file contents):
Revision 371 by tony, Wed Jan 5 15:21:22 2022 UTC vs.
Revision 386 by tony, Tue Jan 18 12:05:35 2022 UTC

# Line 115 | Line 115 | type
115  
116    { TFBStatus }
117  
118 <  TFBStatus = class(TFBInterfacedObject)
118 >  TFBStatus = class(TFBInterfacedObject, IStatus)
119    private
120      FIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
121      FPrefix: AnsiString;
122 +    function SQLCodeSupported: boolean;
123    protected
124      FOwner: TFBClientAPI;
125      function GetIBMessage: Ansistring; virtual; abstract;
# Line 126 | Line 127 | type
127    public
128      constructor Create(aOwner: TFBClientAPI; prefix: AnsiString='');
129      function StatusVector: PStatusVector; virtual; abstract;
130 +    procedure Assign(src: TFBStatus); virtual;
131 +    function Clone: IStatus; virtual; abstract;
132  
133      {IStatus}
134      function GetIBErrorCode: TStatusCode;
# Line 612 | Line 615 | end;
615  
616   { TFBStatus }
617  
618 + function TFBStatus.SQLCodeSupported: boolean;
619 + begin
620 +  Result:= (FOwner <> nil) and assigned(FOwner.isc_sqlcode) and  assigned(FOwner.isc_sql_interprete);
621 + end;
622 +
623   function TFBStatus.GetSQLMessage: Ansistring;
624   var local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar;
625   begin
# Line 628 | Line 636 | begin
636    inherited Create;
637    FOwner := aOwner;
638    FPrefix := prefix;
639 <  FIBDataBaseErrorMessages := [ShowSQLCode, ShowSQLMessage, ShowIBMessage];
639 >  FIBDataBaseErrorMessages := [ShowIBMessage];
640 > end;
641 >
642 > procedure TFBStatus.Assign(src: TFBStatus);
643 > begin
644 >  FOwner := src.FOwner;
645 >  FPrefix := src.FPrefix;
646 >  SetIBDataBaseErrorMessages(src.GetIBDataBaseErrorMessages);
647   end;
648  
649   function TFBStatus.GetIBErrorCode: TStatusCode;
# Line 649 | Line 664 | var IBDataBaseErrorMessages: TIBDataBase
664   begin
665    Result := FPrefix;
666    IBDataBaseErrorMessages := FIBDataBaseErrorMessages;
667 <  if (ShowSQLCode in IBDataBaseErrorMessages) then
653 <    Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
654 <
655 <  if [ShowSQLMessage, ShowIBMessage]*IBDataBaseErrorMessages <> [] then
667 >  if SQLCodeSupported then
668    begin
669 <    if (ShowSQLCode in FIBDataBaseErrorMessages) then
670 <      Result := Result + LineEnding;
659 <    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + ' ';
660 <  end;
669 >    if (ShowSQLCode in IBDataBaseErrorMessages) then
670 >      Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
671  
672 <  if (ShowSQLMessage in IBDataBaseErrorMessages) then
673 <    Result := Result + GetSQLMessage;
672 >    if (ShowSQLMessage in IBDataBaseErrorMessages) then
673 >    begin
674 >      if ShowSQLCode in IBDataBaseErrorMessages then
675 >        Result := Result + LineEnding;
676 >      Result := Result + GetSQLMessage;
677 >    end;
678 >  end;
679  
680    if (ShowIBMessage in IBDataBaseErrorMessages) then
681    begin
682 <    if ShowSQLMessage in IBDataBaseErrorMessages then
682 >    if Result <> FPrefix then
683        Result := Result + LineEnding;
684 <    Result := Result + GetIBMessage;
684 >    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + LineEnding + GetIBMessage;
685    end;
686    if (Result <> '') and (Result[Length(Result)] = '.') then
687      Delete(Result, Length(Result), 1);

Comparing ibx/branches/udr/client/FBClientAPI.pas (property svn:eol-style):
Revision 371 by tony, Wed Jan 5 15:21:22 2022 UTC vs.
Revision 386 by tony, Tue Jan 18 12:05:35 2022 UTC

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines