home *** CD-ROM | disk | FTP | other *** search
/ The Glitch Apple Disk Collection / 2014.glitch.apple.collection.zip / indexed / AAF.DSK / AAF.SHK / UPAAF.BAS < prev    next >
BASIC Source File  |  2000-01-01  |  4KB  |  124 lines

  1.  4  LOMEM: 16384
  2.  5 IN$ = "X": REM  must be first string assigned
  3.  10  TEXT : HOME
  4.  20  PRINT "AAF Unpacker, v1.0"
  5.  22  PRINT : PRINT "by Andy Tefft  (art100@psuvm.psu.edu)"
  6.  24  PRINT : PRINT "This program is freeware. Do what you"
  7.  25  PRINT "want with it, but don't blame me if you"
  8.  26  PRINT "break it."
  9.  28  PRINT : PRINT "Notes (list program for more):"
  10.  30  PRINT : PRINT "1) When asked for a pathname, use"
  11.  32  PRINT "   a full or partial pathname."
  12.  34  PRINT : PRINT "2) Type 'PR#3' before running to use"
  13.  36  PRINT "   80 columns."
  14.  38  PRINT : PRINT "3) Only minimal error checking is done."
  15.  40  PRINT : PRINT "4) Input and output volumes must both"
  16.  42  PRINT "be online."
  17.  44  PRINT : PRINT "Press a key to continue"
  18.  45  GET A$
  19.  50  REM  ARCHIVE FORMAT:
  20.  55  REM
  21.  60  REM  = filename : denotes output file name
  22.  70  REM  - line     : line of output file
  23.  80  REM  + anything : end of file ("anything" ignored")
  24.  85  REM
  25.  86  REM  all other lines echoed to screen
  26.  87  REM
  27.  90  REM  because of the difficulty of editing text files
  28.  91  REM  on the apple //, this program prompts for output
  29.  92  REM  file names, so you can change them if desired.
  30.  93  REM
  31.  94  REM  input anything routine is from an old dos 3.3
  32.  95  REM  public-domain disk
  33.  96  REM
  34.  120  FOR R = 768 TO 788: READ X: POKE R,X: NEXT : REM input-anything
  35.  130  DATA 162,0,32,117,253,160,2,138,145,105,200,169,0,145,105,200
  36.  135  DATA  169,2,145,105,96
  37.  140 D$ =  CHR$ (4)
  38.  145  DIM OU$(100)
  39.  150  PRINT D$"prefix": INPUT PR$
  40.  160  TEXT : HOME
  41.  165  PRINT "AAF Unpacker v1.0  Andy Tefft  11/21/90"
  42.  170  PRINT : PRINT "Prefix: "PR$
  43.  175  PRINT : PRINT "Enter archive pathname, ? for catalog,"
  44.  176  PRINT "/ to change prefix, return to exit."
  45.  180  POKE 34,7
  46.  190  PRINT
  47.  199  ONERR  GOTO 2000
  48.  200  INPUT ": ";C$
  49.  205  IF C$ = "" THEN  END
  50.  210  IF C$ <  > "/" THEN 300
  51.  220  PRINT : INPUT "New prefix:";P$
  52.  230  PRINT D$"Prefix"P$
  53.  240  GOTO 150
  54.  300  IF C$ <  > "?" THEN 400
  55.  310  PRINT D$"cat"
  56.  320  GOTO 190
  57.  400  PRINT : PRINT ">>> Opening "C$" for input."
  58.  405  POKE 34,4:II = 1
  59.  406  PRINT D$"verify"C$
  60.  407 II = 0
  61.  410  PRINT D$"open"C$
  62.  415 IL = 0
  63.  420  PRINT D$"read"C$
  64.  430  CALL 768:IN$ =  MID$ (IN$,1)
  65.  440  IF  LEFT$ (IN$,1) = "=" THEN 450
  66.  445  PRINT IN$: GOTO 430
  67.  450 OU$ =  MID$ (IN$,2)
  68.  455  PRINT ">>> ";
  69.  460  PRINT "Opening "OU$" for output."
  70.  465  PRINT D$: REM  stop taking input from file
  71.  470  PRINT "Press return to use this, enter a new"
  72.  472  PRINT "pathname for output, ? for catalog"
  73.  475  INPUT ": ";CC$
  74.  476  IF CC$ <  > "?" THEN 480
  75.  477  PRINT "Path to catalog, return for current dir"
  76.  478  INPUT P$: PRINT D$"CAT"P$: GOTO 460
  77.  480  IF CC$ <  > "" THEN OU$ = CC$
  78.  485 OO = 1
  79.  490  PRINT D$"open"OU$: PRINT D$"close"OU$: PRINT D$"delete"OU$
  80.  491 OO = 0
  81.  495  PRINT D$"read"C$
  82.  500 OL = 0
  83.  505 FI = 1: REM  means we've started a file
  84.  510  CALL 768:IN$ =  MID$ (IN$,1)
  85.  520  IF  LEFT$ (IN$,1) = "-" THEN 530
  86.  521  IF  LEFT$ (IN$,1) = "+" THEN 1000
  87.  525  PRINT IN$: GOTO 510
  88.  530 OL = OL + 1
  89.  535  VTAB  PEEK (37)
  90.  540 OU$(OL) =  MID$ (IN$,2)
  91.  550  IF OL < 100 GOTO 510
  92.  560  REM   write 100 lines of output file
  93.  570  PRINT D$"open"OU$
  94.  580  PRINT D$"append"OU$
  95.  590  PRINT D$"write"OU$
  96.  600  FOR R = 1 TO 100
  97.  610  PRINT OU$(R)
  98.  620  NEXT
  99.  630  PRINT D$"close"OU$
  100.  640  GOTO 495
  101.  1000  PRINT D$"open"OU$
  102.  1010  PRINT D$"append"OU$
  103.  1020  PRINT D$"write"OU$
  104.  1030  FOR R = 1 TO OL
  105.  1040  PRINT OU$(R): NEXT
  106.  1050  PRINT D$"close"OU$
  107.  1060  PRINT : PRINT ">>> Finished "OU$
  108.  1065 FI = 0
  109.  1070  GOTO 420
  110.  1999  END
  111.  2000 Y =  PEEK (222)
  112.  2001  PRINT
  113.  2005  IF Y = 6 THEN 2100
  114.  2010  IF Y = 5 THEN 2020
  115.  2015  PRINT "Error #"Y: PRINT D$"close": END
  116.  2020  PRINT D$"close": PRINT ">>> End of file encountered."
  117.  2030  IF FI = 1 THEN  PRINT ">>> "OU$" may be incomplete."
  118.  2040  IF FI = 1 THEN  PRINT "(no end of file marker found)"
  119.  2050  TEXT
  120.  2060  END
  121.  2100  IF OO = 1 THEN  PRINT "Volume/directory not found.": GOTO 455
  122.  2110  IF II = 1 THEN  PRINT "Input file not found.": GOTO 175
  123.