home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / FDLA101E.ZIP / FDLARPTS.BAS < prev    next >
Encoding:
BASIC Source File  |  1994-06-04  |  2.3 KB  |  76 lines

  1.     DEFINT A-Z
  2.  
  3.   '   Program Name:  FDLARPTS.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 FDLARpt.Txt
  10.   '                  as input.  Output to FDLARpt(1 to n).Txt
  11.   '
  12.   '           Note:  FDLARPTS.EXE must be executed in the directory
  13.   '                  where FDLARpt.Txt resides.  No specific error checking
  14.   '                  is done to make sure that FDLARpt.Txt exists.  If it
  15.   '                  doesn't the program will BOMB.
  16.   '
  17.   '                  This program is compatable with MS DOS  QBasic and
  18.   '                  may be compiled using QuickBASIC 4.5.  I Linked with
  19.   '                  Crescent Software library P.D.Q. which makes the EXE
  20.   '                  file a LOT SMALLER.
  21.   '
  22.   '                  To run FDLARpts.bas from MS DOS QBasic and return
  23.   '                  to the DOS system prompt run as follows:
  24.   '                  QBASIC /RUN FDLARPTS
  25.  
  26.     DIM Header$(1 TO 50)
  27.  
  28.     ON ERROR GOTO Drats:        'Global error trap
  29.  
  30.   'Open FDLARpt.Txt - output created by BinkLA
  31.   '-------------------------------------------
  32.     OPEN "FDLARpt.Txt" FOR INPUT AS #10         'Read access
  33.  
  34.   'Get the FDLARpt.Txt header info
  35.   '-------------------------------
  36.     x% = 1
  37.     DO UNTIL EOF(10)
  38.         LINE INPUT #10, Header$(x%)
  39.         IF MID$(Header$(x%), 13, 4) = "From" THEN
  40.             EXIT DO
  41.         END IF
  42.         x% = x% + 1
  43.     LOOP
  44.     Rpt% = 1
  45.     DO UNTIL EOF(10)
  46.         Rpt$ = LTRIM$(STR$(Rpt%))
  47.         OPEN "FDLARpt" + Rpt$ + ".Txt" FOR OUTPUT AS Rpt%
  48.  
  49.       'Write Out "FDLARptn.Txt"
  50.       '------------------------
  51.         FOR H% = 1 TO x%
  52.             PRINT #Rpt%, Header$(H%)
  53.         NEXT
  54.         DO
  55.             LINE INPUT #10, ReportBody$
  56.             IF LEFT$(ReportBody$, 1) = "" THEN
  57.               'do nothing
  58.             ELSE
  59.                 PRINT #Rpt%, ReportBody$
  60.             END IF
  61.         LOOP UNTIL LEFT$(ReportBody$, 1) = "╘" OR LEFT$(ReportBody$, 1) = ">" OR EOF(10)
  62.         CLOSE Rpt%
  63.         Rpt% = Rpt% + 1
  64.         PRINT "FDLARpt" + Rpt$ + ".Txt - Done"
  65.     LOOP
  66.     PRINT "Finished!"
  67.     CLOSE : SYSTEM
  68.  
  69. Drats:
  70.  
  71.     BEEP
  72.     PRINT "Program bombed!"
  73.     SYSTEM
  74.  
  75.  
  76.