8-Bit Software Online Conversion

Sorting Article Part III - Listing

10ONERRORCLOSE#0:REPORT:PRINTERL:END 20MODE7:VDU23;8202;0;0;0; 30VDU28,0,24,39,2 40X1%=?&308:X2%=?&30A 50Y1%=?&309:Y2%=?&30B 60C%=X2%-X1%:R%=Y1%-Y2%-1 70H$=" Filename :" 80REPEAT:READfile$:PROCprint:UNTILfil e$="END" 90MODE7:PRINTTAB(10,10);" THE END.":E ND 100DEFPROCprint 110IF file$="END" ENDPROC 120PROCheader:PROCzap:CLS 130chan%=OPENIN(file$):len%=EXT#(chan% ) 140PROCzip 150PROCmessprnt 160CLOSE#chan% 170PRINT'" <SPACE>";:REPEAT:A=GET:UNT ILA=32 180ENDPROC 190DEFPROCmessprnt:E%=0:D%=0 200C$=" ":REPEAT 210B$="":REPEAT:B$=B$+C$:C$=CHR$(BGET# chan%) 220UNTIL(C$=" ")OR(C$=CHR$(&0D))OR(EOF #(chan%)) 230L%=LEN(B$) 240IF B$=CHR$(&0D) THEN PRINT:E%=E%+1: D%=0:GOTO260 250IF (D%+L%)>C% PROCnewl ELSE PRINTB$ ;:D%=D%+L% 260UNTIL EOF#(chan%) 270ENDPROC 280DEFPROCnewl 290IF E%>R%-2:PRINT'" <SPACE>";:E%=0: REPEAT:A=GET:UNTILA=32:CLS:PRINTB$;:D%=L % ELSE PRINT'B$;:E%=E%+1:D%=L% 300ENDPROC 310DEFPROCheader:$&7C00=" ":$&7C00=(H$+" " +file$):ENDPROC 320DEFPROCzap:FORZ%=1TO30 STEP 2:PROCc trc:NEXTZ%:ENDPROC 330DEFPROCzip:FORZ%=30 TO 0 STEP -2:PR OCctrc:NEXTZ%:ENDPROC 340DEFPROCctrc 350VDU23;1,40-Z%;0;0;0; 360VDU23;2,51-(Z%/2);0;0;0; 370VDU23;6,25-(Z%*23/30);0;0;0; 380VDU23;7,26-(Z%/3);0;0;0; 390ENDPROC 400DATAW.COUNTER 410DATAW.COUNT1 420DATAW.COUNT2 430DATAW.CONCLUS 440DATAW.BIBLO 450DATAEND