PROCEDURE (hidden) rap$handle_status (
  status_input, si: status = $required
  status_output, so: (VAR) status = $required
  )


*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'

"
" PURPOSE:
"   This procedure handles a bad status returned by some event on behalf of the calling procedure.
"
" DESIGN:
"   If there is any event message for the status to be handled it is displayed.  The status itself is
"   displayed.  Finally, the procedure returns with a general warning error if the error passed to it
"   was at error level or higher.  The event message is cleared.
*IFEND


  "$FORMAT=OFF
  VAR
    rav$event_message: (XREF) status
    status_input: status = $value(status_input)
  VAREND
  "$FORMAT=ON"


  IF NOT rav$event_message.normal THEN
    $system.put_line ' '//$strrep(rav$event_message) o=$response
    rav$event_message.normal=true
  IFEND

  $system.put_line l=(' '//$strrep(status_input) '  ') o=$response

  IF $variable(rav$errors_occurred, nonlocal) THEN
    "$FORMAT=OFF
    VAR
      rav$errors_occurred: (XREF) boolean
    VAREND
    "$FORMAT=ON"
    rav$errors_occurred=true
  IFEND

  IF $condition(status_input.condition)= 'RAE$ERRORS_OCCURRED_WARNING' THEN
    "Do not change STATUS_OUTPUT since warning error indicates more severe
    "error has already been recorded.
  ELSE
    $value(status_output)=$status(false, 'RA', rae$errors_occurred_warning)
  IFEND

PROCEND rap$handle_status
