home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / BKLA201D.ZIP / BKLARPTS.BAS < prev    next >
BASIC Source File  |  1994-04-13  |  3KB  |  80 lines

  1.     DEFINT A-Z
  2.   
  3.   '   Program Name:  BKLARPTS.EXE
  4.   '         Author:  R.J.(Bob) Ross  FidoNet 1:134/75
  5.   '   Date Started:  January 25th. 1992
  6.   ' Date Completed:  Revised February 19, 1992
  7.   '                  Revised April 13, 1994
  8.   '
  9.   '        Purpose:  To make separate reports using BKLARpt.Txt
  10.   '                  as input.  Output to BKLARpt(1 to n).Txt
  11.   '
  12.   '           Note:  BKLARPTS.EXE must be executed in the directory
  13.   '                  where BKLARpt.Txt resides.  No specific error checking
  14.   '                  is done to make sure that BKLARpt.Txt exists.  If it
  15.   '                  doesn't the program will BOMB.
  16.   '
  17.   '                  This program will not work if you use the -NHA switch
  18.   '                  with BinkLA.  If you need to use the -NHA switch and
  19.   '                  produce separate outputs, contact me and I can give
  20.   '                  details on how this can be accomplished by modifying
  21.   '                  the Binklae.lng file
  22.   '
  23.   '                  This program is compatable with MS DOS  QBasic and
  24.   '                  may be compiled using QuickBASIC 4.5.  I Linked with
  25.   '                  Crescent Software library P.D.Q. which makes the EXE
  26.   '                  file a LOT SMALLER.
  27.   '
  28.   '                  To run BKLARpts.bas from MS DOS QBasic and return
  29.   '                  to the DOS system prompt run as follows:
  30.   '                  QBASIC /RUN BKLARPTS
  31.   
  32.     DIM Header$(1 TO 50)
  33.   
  34.     ON ERROR GOTO Drats:        'Global error trap
  35.   
  36.   'Open BKLARpt.Txt - output created by BinkLA
  37.   '-------------------------------------------
  38.     OPEN "BKLARpt.Txt" FOR INPUT AS #10         'Read access
  39.   
  40.   'Get the BKLARpt.Txt header info
  41.   '-------------------------------
  42.     x% = 1
  43.     DO UNTIL EOF(10)
  44.         LINE INPUT #10, Header$(x%)
  45.         IF RIGHT$(Header$(x%), 3) = "Hrs" THEN
  46.             EXIT DO
  47.         END IF
  48.         x% = x% + 1
  49.     LOOP
  50.     Rpt% = 1
  51.     DO UNTIL EOF(10)
  52.         Rpt$ = LTRIM$(STR$(Rpt%))
  53.         OPEN "BKLARpt" + Rpt$ + ".Txt" FOR OUTPUT AS Rpt%
  54.       
  55.       'Write Out "BKLARptn.Txt"
  56.       '------------------------
  57.         FOR H% = 1 TO x%
  58.             PRINT #Rpt%, Header$(H%)
  59.         NEXT
  60.         DO
  61.             LINE INPUT #10, ReportBody$
  62.             IF LEFT$(ReportBody$, 1) = "" THEN
  63.               'do nothing
  64.             ELSE
  65.                 PRINT #Rpt%, ReportBody$
  66.             END IF
  67.         LOOP UNTIL LEFT$(ReportBody$, 1) = "╘" OR EOF(10)
  68.         CLOSE Rpt%
  69.         Rpt% = Rpt% + 1
  70.         PRINT "BKLARpt" + Rpt$ + ".Txt - Done"
  71.     LOOP
  72.     CLOSE : SYSTEM
  73.   
  74.     Drats:
  75.   
  76.     BEEP
  77.     PRINT "Program bombed!"
  78.     SYSTEM
  79.   
  80.