*copyc OSD$DEFAULT_PRAGMATS
?? NEWTITLE := 'NOS/VE : Interactive Facility' ??
?? NEWTITLE := '  [XDCL, #GATE] iip$report_status_error' ??
MODULE iim$report_status_error;


{ Global External Procedure Declarations
*copyc IFV$MODULE_FOR_C180
?? SET (LIST := OFF) ??
*copyc PMP$LOG
*copyc OSP$UNPACK_STATUS_CONDITION
?? SET (LIST := ON) ??


{ Global Constants and Types
?? SET (LIST := OFF) ??
*copyc OST$STATUS
?? SET (LIST := ON) ??

?? TITLE := 'PROCEDURE [XDCL, #GATE] iip$report_status_error', EJECT ??

  PROCEDURE [XDCL, #GATE] iip$report_status_error (VAR error_status: ost$status;
    message: string ( * ));

    CONST
      legend_1 = 'Status error on ',
      legend_2 = 'Id:   ; Cond:         ',
      legend_3 = 'Text:                                ';

    VAR
      identifier: ost$status_identifier,
      number: ost$status_condition_number,
      line: string (255),
      status: ost$status,
      i: integer;

{ Log the kind of error report that is to follow

    line (1, 16) := legend_1;
    line (17, STRLENGTH (message)) := message;
    pmp$log (line (1, 16 + STRLENGTH (message)), status);

{ Log the status id and condition code

    line (1, 22) := legend_2;
    osp$unpack_status_condition (error_status.condition, identifier, number);
    line (5, 2) := identifier;
    STRINGREP (line (14, 8), i, number);
    pmp$log (line (1, 22), status);

{ Log the status text

{   line (1, 37) := legend_3;
{   line (7, error_status.text.size) := error_status.text.value (1,
{     error_status.text.size);
{   pmp$log (line (1, 6 + error_status.text.size), status);

  PROCEND iip$report_status_error;
MODEND
