S
PL_
PL_
PL_DEALLOC.PLCB{%}{WTHEN\ELSE}
*
      IF {%1} < 100000 THEN
         S$ = CALLFN('00':         \
                     FNR.DEALLOC.PLCB:          \ ;* Function code
                     OCONV({%1},'MCDX')'R%4'    \ ;* P.NO
                     )
*
         IF S$[3,4] = IPX.SOCKET.NO THEN
            ERR = 0
            RES = OCONV(S$[7,4],'MCXD')
            IF RES > 32768 THEN
               RES = RES - 65536
            END ELSE
               LOCATE({%1},RESOURCE.LIST,1;L$$$) THEN
                  RESOURCE.LIST = DELETE(RESOURCE.LIST,1,L$$$,0)
               END
            END
         END ELSE
            ERR = 1
            RES = 0
         END
      END ELSE
         ERR = 0
         RES = 0
      END
*
      IF NOT(ERR) AND RES >= 0 {%2}
