home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 349_01 / sss.arc / EX_0209.BAS < prev    next >
BASIC Source File  |  1991-04-17  |  779b  |  43 lines

  1. ' Program EX_0209.BAS
  2. ' Listing 3B - see documentation in TUTOR.SSS
  3.  
  4. common shared pv, pt
  5. declare function rnx (m, s)
  6. declare sub prime ()
  7.  
  8. rem $include: 'SSSB.H'
  9.  
  10.   call prime
  11.  
  12.   do
  13.     if RA < .25 then x = ER(2, 2) else x = TR(1, 3, 4)
  14.     TALLY 1, x
  15.     pt = pt + x
  16.     TALLY 2, pt - pv
  17.     pv = pt
  18.     pt = pt + rnx(7, 4)
  19.   loop while pt <= 120
  20.  
  21.   title$ = "  "
  22.   SUMRY sadd(title$)
  23.   title$ = "RESULTS "
  24.   SUMRY sadd(title$)
  25.  
  26. sub prime
  27.   INIQUE 0, 0, 2
  28.   title$ = "Call duration          "
  29.   INISTA 1, sadd(title$), 0, 12, 2, .5
  30.   title$ = "Cycle time             "
  31.   INISTA 2, sadd(title$), 0, 0, 0, 0
  32.   pv = 0!
  33.   pt = rnx(7, 4)
  34. end sub
  35.  
  36. function rnx (m, s)
  37.   do
  38.     x = RN(m, s)
  39.   loop while x <= 0!
  40.   rnx = x
  41. end function
  42.  
  43.