8-Bit Software Online Conversion

Boxes Style Screen - Listing

10REM >Boxes 20REM by Steven Flintham 30REM 40REM A demonstration of the "boxed" style in mode 7 50REM 60REM Monday 7th September 1992 70: 80MODE 7 90VDU 23;8202;0;0;0; 100PROCdisable 110PROCinit 120PROCdemonstrate 130MODE 7 140PROCenable 150END 160: 170DEF PROCdemonstrate 180PROCtitle("Boxed style demonstratio n",3,4) 190PROCbox("Purpose",4,3,7,0,7,39,2,TR UE) 200PRINT "This program demonstrates th e use" 210PRINT "of the boxed style in mode 7 ."; 220PROCbox("Comments",4,3,7,0,22,39,8, TRUE) 230PRINT "The main problem with this s tyle isthat the box and the control code s" 240PRINT "to produce it narrow the scr een" 250PRINT "quite considerably. A second ary" 260PRINT "problem with the same cause is thatcentred text (like the title of t hescreen) can look off-centre becauseof the control codes taking up" 270PRINT "space at the edge of the scr een." 280PRINT "You may wish to deliberately offsettitles to overcome this."; 290VDU 26 300PRINTTAB(6,24);CHR$131;"Press SPACE to continue..."; 310*FX21 320REPEAT UNTIL GET 330ENDPROC 340: 350DEF PROCbox(title$,border%,title`fo re%,body`fore%,bx%,by%,tx%,ty%,window%) 360LOCAL y% 370IF (tx%-bx%)<10 OR (by%-ty%)<4 THEN ENDPROC 380VDU 26 390PRINTTAB(bx%+2,ty%);CHR$(144+border %);STRING$(LEN(title$)+4,CHR$240) 400PRINTTAB(bx%,ty%+1);CHR$(144+border %);CHR$188;CHR$172;CHR$181;CHR$(128+titl e`fore%);title$;CHR$(144+border%);CHR$23 4;STRING$(tx%-bx%-LEN(title$)-7,CHR$172) ;CHR$236 410PRINTTAB(bx%,ty%+2);CHR$(144+border %);CHR$181;" ";STRING$(LEN(title$)+4,CHR $163);TAB(tx%,ty%+2);CHR$234 420FOR y%=ty%+3 TO by%-1 430PRINTTAB(bx%,y%);CHR$(144+border%); CHR$181;CHR$(128+body`fore%);TAB(tx%-1,y %);CHR$(144+border%);CHR$234; 440NEXT 450PRINTTAB(bx%,by%);CHR$(144+border%) ;CHR$173;STRING$(tx%-bx%-2,CHR$172);CHR$ 174; 460IF window% THEN VDU 28,bx%+3,by%-1, tx%-2,ty%+3 470ENDPROC 480: 490DEF PROCdisable 500*FX229,1 510*FX4,2 520ENDPROC 530: 540DEF PROCinit 550ON ERROR MODE 7:REPORT:PRINT " at l ine ";ERL:PROCenable:END 560ENDPROC 570: 580DEF PROCenable 590*FX229,0 600*FX4,0 610ENDPROC 620: 630DEF PROCtitle(title$,fore%,back%) 640LOCAL x% 650x%=20-LEN(title$)/2 660PRINTTAB(x%-4,0);CHR$141;CHR$(128+b ack%);CHR$157;CHR$(128+fore%);title$;" ";CHR$156 670PRINTTAB(x%-4,1);CHR$141;CHR$(128+b ack%);CHR$157;CHR$(128+fore%);title$;" ";CHR$156 680ENDPROC