8-Bit Software Online Conversion
Program Chopper/Joiner - Listing
10REM CHOPPER - FILE SPLITTER
20REM Version 0.4
30REM By Andrew Black
40REM (c) Andrew Soft 1991
50:
60REM" This program has been placed
70REM" into Public Domain.
80:
90VDU22,7
100PROCtitle
110:
120ON ERROR PROCerror(0)
130extra%=0:*FX14,6
140VDU23;8202;0;0;0;
150:
160INPUT" Enter source drive: "sdrive%
170IF sdrive%>3 OR sdrive%<0 GOTO 160
180PRINT
190INPUT" Enter destination drive: "dd
rive%
200IF ddrive%>3 OR ddrive%<0 GOTO 190
210CLS
220PRINT
230INPUT" Enter file to split: "file$
240file$=":"+STR$(sdrive%)+"."+file$
250:
260input%=OPENIN(file$)
270:
280IF input%=0 THEN PROCerror(1)
290:
300length%=EXT# input%
310time%=length% DIV 116
320PRINT'" File "+file$+" is &";÷lengt
h%;" bytes long"
330:
340PRINT
350INPUT" Enter block size: "bsize$
360bsize%=EVAL(bsize$)
370IF bsize%>length% OR bsize%<1 THEN
GOTO 350
380:
390blocks%=length% DIV bsize%
400bits%=length% MOD bsize%
410IF bits%>0 THEN extra%=1
420:
430PRINT'SPC1;blocks%+extra%" files wi
ll be produced."
440PROCcontinue
450PRINT
460INPUT" Enter file standard: "sfile$
470IF LEN(sfile$)>5 THEN GOTO 460
480sfile$=":"+STR$(ddrive%)+".L."+sfil
e$
490PRINT'" This will take ";(time% DIV
60);" mins and ";(time% MOD 60);" secs.
"
500PRINT
510:
520FOR I%=1 TO blocks%
530:
540output%=OPENOUT(sfile$+STR$(I%))
550PRINTCHR$(134)+MID$(sfile$+STR$(I%)
,4,LEN(sfile$+STR$(I%)))
560:
570FOR Q%=1 TO bsize%
580BPUT# output%, BGET# input%
590NEXT
600:
610CLOSE#output%
620:
630NEXT
640:
650IF extra%=0 THEN CLOSE#input%:PRINT
'" Successful transfer":I$=INKEY$(200):P
ROCexit
660:
670output%=OPENOUT(sfile$+STR$(I%))
680PRINTCHR$(134)+MID$(sfile$+STR$(I%)
,4,LEN(sfile$+STR$(I%)))
690:
700FOR N%=1 TO bits%
710BPUT# output%, BGET# input%
720NEXT
730:
740CLOSE#output%
750CLOSE#input%
760:
770PRINT'" Successful transfer":I$=INK
EY$(200):PROCexit
780END
790:
800DEF PROCerror(num%)
810PRINT'" Error! Error! "
820PRINT
830IF num%=1 THEN PRINT"File "+file$+"
is not on the disc.":CLOSE#0:END
840:
850REPORT:END
860ENDPROC
870:
880DEFPROCtitle
890PRINT"
ppppppppppp";
900VDU134,157,141
910PRINT" File Chopper by Andrew Black
"
920VDU134,157,141
930PRINT" File Chopper by Andrew Black
"
940PRINT"
£££££££££££"
950VDU28,0,24,39,4
960ENDPROC
970:
980DEFPROCexit
990CLS
1000INPUT" Exit (Y/N)",ext$
1010IFext$="N"THENCLS:GOTO110
1020END
1030ENDPROC
1040:
1050DEF PROCcontinue
1060PRINT" Continue (Y/N)"
1070G$=GET$
1080IF G$="Y" THEN ENDPROC
1090CLOSE#0:CLS:GOTO110
1100ENDPROC