      REM ERROR.EXIT
*PIC-LAN
*INCLUDE
*
*
*N
*
*
*
*
*
************************************************************************
************************************************************************
***                                                                  ***
*** COPYWRITE 1988-2002 MODULAR SOFTWARE                             ***
***                                                                  ***
*** THIS PROGRAM IS PROPRIETARY TO MODULAR SOFTWARE AND MAY NOT BE   ***
*** USED, COPIED, EXAMINED, OR DISCLOSED WITHOUT A VALID LICENSE     ***
*** FROM MODULAR SOFTWARE.                                           ***
***                                                                  ***
************************************************************************
************************************************************************
*
*
*
90000 REM Exit cleanup routine
*
      FOR I$$$ = 1 TO DCOUNT(RESOURCE.LIST<1>,VM)
         LOOP
            PL_CLOSE RESOURCE.LIST<1,I$$$> ELSE NULL
         UNTIL ERR OR RES DO
            PL_SHORT.SLEEP
         REPEAT
         PL_DEALLOC.PLCB RESOURCE.LIST<1,I$$$> ELSE NULL
      NEXT I$$$
      LOOP WHILE RESOURCE.LIST<2> # '' DO
         PL_BCB.DEALLOC RESOURCE.LIST<2,1>
      REPEAT
*
      RETURN
*
99999 REM Error Exit routine
*
      S.ERR = ERR
      S.RES = RES
*
      GOSUB 90000
*
      IF S.ERR OR S.RES THEN
         CALL PL.ERRMSG(S.RES,S.ERR,RESULT)
         STOP 'PL-90',RESULT<1>
      END
*
      STOP
