home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol268 / anser.for < prev    next >
Encoding:
Text File  |  1986-05-22  |  1.8 KB  |  56 lines

  1.     SUBROUTINE    ANSER( NSET,QSET )
  2. C////////////////////////////////////////////////////////////////
  3. C/                                /
  4. C/    Program-id.    ANSER.FOR                /
  5. C/    Date-written.    11th,Feb,1984                /
  6. C/    Remarks.    Subroutine ANSER ia called whenever an    /
  7. C/            answer to request is ready.        /
  8. C/            From page 275                /
  9. C/                                /
  10. C////////////////////////////////////////////////////////////////
  11. C
  12.     DIMENSION    NSET(1),QSET(1)
  13.         COMMON/C1/ID,IM,INIT,JEVNT,JMNIT,MFA,MSTOP,MX,MXC,NCLCT,NHIST,
  14.      $  NOQ,NORPT,NOT,NPRMS,NRUN,NRUNS,NSTAT,OUT,ISEED,TNOW,
  15.      $  TBEG,TFIN,MXX,NPRNT,NCRDR,NEP,VNQ(4),IMM,MAXQS,MAXNS
  16.     COMMON /C2/ATRIB(10),ENQ(4),INN(4),JCELS(5,22),KRANK(4),
  17.      $  MAXNQ(4),MFE(4),MLC(4),MLE(4),NCELS(5),NQ(4),PARAM(20,4),
  18.      $  QTIME(4),SSUMA(10,5),SUMA(10,5),NAME(6),NPROJ,MON,NDAY,NYR,
  19.      $  JCLR,JTRIB(12)
  20.     COMMON /U1/ NARC,NSCAN,JBUFF,NSTA(10),JRPLY(10)
  21.     COMMON /U2/ XL,NTER,IBUFF,CDIAL(2),CREAD(2),SRTIM,SCTIM,
  22.      $  TRTIM,DLTIM,COMTIM(2)
  23. C
  24. C    --- Find request for which an answer has been determined
  25. C        and remove it from the file of calls requested and stored 
  26. C        in the buffer.
  27. C
  28.     J  = JTRIB( 2 )
  29.     CALL    FINDN( J,5,3,2,KCOL,NSET,QSET )
  30.     CALL    RMOVE( KCOL,3,NSET,QSET )
  31.     TI = TNOW - ATRIB( 1 )
  32.     CALL    COLCT( TI,1,NSET,QSET )
  33.     SUMT = SRTIM + SCTIM + TRTIM + DLTIM
  34.     DELT = ( COMTIM(2) - COMTIM(1) + SUMT ) / 20.0
  35.     CALL    HISTO( TI,SUMT,DELT,1 )
  36.     JRPLY( J ) = 4
  37. C
  38. C    --- Schedule an end of service event for the customer to
  39. C        occur at current time plus customer's reading time
  40. C
  41.     ATRIB(1) = TNOW + UNFRM( CREAD(1),CREAD(2) )
  42.     JTRIB(1) = 5
  43.     CALL    FILEM(1,NSET,QSET)
  44. C
  45. C    --- Determine if buffer was full 
  46. C
  47.     IF ( JBUFF ) 2,2,1
  48. C
  49. C    --- If buffer was full, set it to nonfull status and call 
  50. C        subroutine SCAN to start the scanner moving again.
  51. C
  52. 1    JBUFF = 0
  53.     CALL    SCAN( NSET,QSET )
  54. 2    RETURN
  55.     END
  56.