10 REM Generate a universal header for a 20 REM data file 30 : 40 MODE7 50 PRINT"Universal file generator"' 60 osas=&FFE3:osfi=&FFDD 70 header=109:REM Size of BASIC header 80 DIMprint% 128 90 : 100 INPUT"File to append: "F$ 110 INPUT"Chosen value of PAGE: "page$ 120 page%=(EVAL(page$) DIV256)*256 130 IFpage%<&E00 THENPRINT'"Bad PAGE":END 140 PRINT"Line 1:";:line1$=FNgetline 150 PRINT"Line 2:";:line2$=FNgetline 160 PRINT"Line 3:";:line3$=FNgetline 170 : 180 PRINT'"Opening ";F$;" to save at &";~page% 190 PRINT"Final version is 'OUTPUT'" 200 F=OPENIN F$:IFF=0 THENCLOSE#F:PRINT'"Not found":END 210 lof%=EXT#F 220 : 230 REM Assemble as though ABOVE the data file 240 FORX=4 TO7 STEP3 250 P%=page%+lof%+header:O%=print% 260 [OPTX 270 .entry 280 LDY#0 290 .printhelp 300 LDApage%,Y:BMIdone:JSRosas:INY:BPLprinthelp 310 .done 320 RTS 330 ] 340 NEXT 350 REM Splice the 2 files together 360 PTR#F=0:O=OPENOUT"OUTPUT" 370 PROCputline(CHR$13+CHR$10+CHR$10+CHR$32+"*| "+line1$) 380 PROCputline(CHR$13+CHR$10+CHR$10+CHR$32+"*| "+line2$) 390 PROCputline(CHR$13+CHR$10+CHR$10+CHR$32+"*| "+line3$) 400 PROCputline(CHR$13+CHR$10+CHR$10+CHR$10+"*FX119") 410 PROCputline(CHR$13+CHR$255+CHR$21):REM End the BASIC file and turn off the VDU 420 REPEAT 430 byte%=BGET#F:BPUT#O,byte% 440 UNTILEOF#F 450 : 460 FORoffset%=print% TO(O%-1) 470 BPUT#O,?offset% 480 NEXT 490 : 500 CLOSE#F:CLOSE#O 510 : 520 REM Now set the attributes 530 FORX=0TO2STEP2 540 P%=print% 550 [OPTX 560 .block 570 EQUW fname:\Pointer to fname 580 EQUW page% 590 EQUW &FFFF:\Load addr (4b) 600 EQUW page%+lof%+header 610 EQUW &FFFF:\Exec addr (4b) 620 EQUD 0 630 EQUD 0 640 .fname 650 EQUS"OUTPUT"+CHR$13 660 ] 670 NEXT 680 X%=print% MOD256:Y%=print% DIV256 690 A%=1:CALL osfi 700 PRINT'"Done." 710 END 720 : 730 DEFPROCputline(string$) 740 FORoffset%=1TOLENstring$:BPUT#O,ASCMID$(string$,offset%,1):NEXT 750 ENDPROC 760 : 770 DEFFNgetline 780 work$="":Y%=VPOS 790 REPEAT 800 key%=GET 810 IFkey%=127 THENwork$=LEFT$(work$,LENwork$-1) 820 IFkey%=21 THENwork$="" 830 IFkey%<>13 ANDkey%<>127 ANDkey%<>21 THENwork$=work$+CHR$key% 840 PRINTTAB(7,Y%);work$;STRING$(25-LENwork$," "); 850 UNTILkey%=13 ORLENwork$=25 860 work$=work$+STRING$(25-LENwork$," "):PRINT 870 =work$ 880