home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / gwbasic / spiele / xaprt.bas < prev    next >
Encoding:
BASIC Source File  |  1980-01-01  |  1.5 KB  |  41 lines

  1. 10 ' process compuserve xa files downloaded using the command CAT/DES
  2. 20 ' by Mike Cumming
  3. 30 '
  4. 40 CLS
  5. 50 PRINT "                  PRINT COMPUSERVE DATA FILES
  6. 60 PRINT
  7. 70 INPUT "Enter name of the datafile containing file information ";NAM$
  8. 80 ON ERROR GOTO 100
  9. 90 OPEN NAM$ FOR INPUT AS #1:GOTO 110
  10. 100 RESUME 70
  11. 110 ON ERROR GOTO 500
  12. 120 PRINT
  13. 130 PRINT "Align paper in the printer.  Press any key when ready."
  14. 140 WHILE INKEY$="":WEND
  15. 150 LINES=0 ' count printer lines, skip perferation
  16. 160 IF MID$(NAM$,2,1)=":" THEN NAM$=MID$(NAM$,2,LEN(NAM$)) ' remove drive spec
  17. 170 TF$=CHR$(13)+"       Compuserve XA file "+NAM$+CHR$(13)+CHR$(13) ' header
  18. 180 LPRINT TF$
  19. 190 WHILE NOT EOF(1)
  20. 200    LINE INPUT #1,LIN$
  21. 220 ' expect user id as first line of data.  if not read new line
  22. 230    IF LEFT$(LIN$,1)<>"[" THEN LINE INPUT #1,LIN$:GOTO 230
  23. 240 ' get program name, date, and size and print it
  24. 250    IF LINES>45 THEN LPRINT CHR$(12)+TF$:LINES=0
  25. 260    LINE INPUT #1,LIN$
  26. 265    X=INSTR(LIN$,"("):IF X>0 THEN X=X-1 ELSE X=31
  27. 270    LPRINT LEFT$(LIN$,X)
  28. 280 ' ignore 3 lines of garabage (keywords)
  29. 290    FOR X=1 TO 3:LINE INPUT #1,LIN$:NEXT
  30. 300 ' print program description
  31. 310    LIN$=" "
  32. 320   WHILE LIN$<>""
  33. 330     LINE INPUT #1,LIN$
  34. 340     IF LINES>45 THEN LPRINT CHR$(12)+TF$:LINES=0
  35. 350     LPRINT MID$(LIN$,2,LEN(LIN$)):LINES=LINES+1
  36. 360   WEND
  37. 370 WEND
  38. 500 IF ERR<>27 THEN RESUME NEXT
  39. 510 PRINT:PRINT "Printer is out of paper.  Correct and press any key"
  40. 520 WHILE INKEY$="":WEND:RESUME NEXT
  41.