home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / portfoli / pfboot.lzh / pfload.bas < prev    next >
BASIC Source File  |  1991-08-21  |  4KB  |  108 lines

  1.         ' PFLOAD - Atari Portfolio Bootstrap File Loader
  2.         ' Written by Michael D. Weisner, Jan 6, 1990
  3.         ' Placed in public domain to help others in need
  4.         '
  5.         ' Called from PFBOOT.BAT
  6.         '
  7.         PRINT "PFLOAD - Atari Portfolio loader"
  8.         OPEN "B", #1, COMMAND$
  9.         OPEN ENVIRON$("PFSPEC") FOR RANDOM AS #2
  10.         lf$ = CHR$(10)
  11.         eofchr$ = CHR$(26)
  12.         a$ = " "
  13.         eofflag = 0
  14.         n = 0
  15.         PRINT "Downloading "; COMMAND$; "...";
  16.         t = TIMER + 1
  17.         DO
  18.         LOOP UNTIL TIMER > t
  19.         IF LOC(2) THEN b$ = INPUT$(LOC(2), #1)
  20.         DO
  21.                 GET #1, , a$
  22.                 n = n + 1
  23.                 IF EOF(1) THEN
  24.                         EXIT DO
  25.                 ELSE
  26.                         PRINT #2, a$;
  27.                         IF a$ = eofchr$ THEN eofflag = 1
  28.                         IF (n MOD 128) = 0 OR a$ = lf$ THEN
  29.                                 t = TIMER + .25
  30.                                 DO
  31.                                 LOOP UNTIL TIMER > t
  32.                         END IF
  33.                 END IF
  34.         LOOP
  35.         IF eofflag = 0 THEN PRINT #2, eofchr$;
  36.         CLOSE #1
  37.         ON ERROR GOTO errchk
  38.         OPEN "i", #1, "chksum.dat"
  39.         PRINT "checking...";
  40.         DO
  41.         LOOP UNTIL (LOC(2) >= 4 OR INKEY$ <> "")
  42.         IF LOC(2) >= 4 THEN
  43.                 a$ = INPUT$(4, #2)
  44.                 INPUT #1, b$
  45.                 IF a$ <> b$ THEN
  46.                         PRINT
  47.                         PRINT "Bad Checksum"; TAB(30); "Good Checksum"
  48.                         PRINT a$; TAB(30); b$
  49.                 ELSE
  50.                         PRINT "OK"
  51.                         CLOSE #1
  52.                         KILL "chksum.dat"
  53.                END IF
  54.         ELSE
  55.                 PRINT "No response from Portfolio, abort"
  56.         END IF
  57.         CLOSE #1
  58.         CLOSE #2
  59.         SYSTEM
  60.  
  61. errchk: IF ERR = 53 THEN
  62.                 ' CHKSUM.DAT does not exist, no checking
  63.                 PRINT "no checking"
  64.         ELSE
  65.                 DO
  66.                         READ a, a$
  67.                 LOOP UNTIL (a = ERR OR a = 256)
  68.                 PRINT
  69.                 PRINT a$
  70.         END IF
  71.         RESUME errnext
  72. errnext:
  73.         ON ERROR GOTO 0
  74.         CLOSE #1
  75.         CLOSE #2
  76.         SYSTEM
  77.  
  78.         DATA 2,"Syntax error in DATA statement"
  79.         DATA 3,"RETURN without GOSUB",4,"Out of DATA"
  80.         DATA 5,"Illegal function call",6,"Arithmetic overflow"
  81.         DATA 7,"Out of memory for file buffer"
  82.         DATA 9,"Subscript out of range"
  83.         DATA 10,"Redimensioned array"
  84.         DATA 11,"Division by zero",13,"Argument type mismatch"
  85.         DATA 14,"Out of string space"
  86.         DATA 16,"String formula too complex",19,"No RESUME"
  87.         DATA 20,"RESUME without error",24,"Device timeout"
  88.         DATA 25,"Device fault",27,"Out of paper"
  89.         DATA 39,"CASE ELSE expected",40,"Variable required"
  90.         DATA 50,"FIELD overflow"
  91.         DATA 51,"Internal error"
  92.         DATA 52,"Bad file name or number",53,"File not found"
  93.         DATA 54,"Bad file mode",55,"File already open"
  94.         DATA 56,"FIELD statement active",57,"Device I/O error"
  95.         DATA 58,"File already exists",59,"Bad record length"
  96.         DATA 61,"Disk full",62,"Input past end"
  97.         DATA 63,"Bad record number",64,"Bad file name"
  98.         DATA 67,"Too many files",68,"Device unavailable"
  99.         DATA 69,"Communication buffer overflow"
  100.         DATA 70,"Permission denied (write protected disk)"
  101.         DATA 71,"Disk not ready",72,"Disk media error"
  102.         DATA 73,"Advanced feature unavailable",74,"Rename across disks"
  103.         DATA 75,"Path/File accesss error",76,"Path not found"
  104.         DATA 256,"No description for error"
  105.         
  106.  
  107.  
  108.