home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
boo.tar.gz
/
boo.tar
/
m4boo.bas
< prev
next >
Wrap
BASIC Source File
|
1986-10-22
|
634b
|
19 lines
10 INPUT "Input filename";INFILE$
20 INPUT "Output filename (/CMD file)";OUTFILE$
30 OPEN "I",1,INFILE$:OPEN "O",2,OUTFILE$
40 WHILE (EOF(1)=0)
50 INPUT #1,A$:IF INSTR(A$,"*****")<>0 THEN 150
60 FOR T=1 TO LEN(A$) STEP 2: B=VAL("&h"+MID$(A$,T,2))
70 SUM=(SUM+B) AND -4097
80 PRINT #2,CHR$(B);
90 NEXT T
100 WEND
110 PRINT "Error: Early End-Of-File Encountered!"
120 PRINT "Last record read:"
130 PRINT A$
140 CLOSE: END
150 I=INSTR(A$," ")+1:J=INSTR(I,A$," ")-I:NEWSUM=VAL(MID$(A$,I,J))
160 IF NEWSUM=SUM THEN PRINT "Checksum OK:";NEWSUM;"=";SUM: GOTO 180
170 PRINT "Bad checksum:";NEWSUM;"<>";SUM
180 CLOSE: END