47. Mode 7 box ~~~~~~~~~~ This is a very handy little Procedure for drawing a box around text in Mode 7. You can print the text before or after drawing the box. You call the Procedure by giving the 4 co-ordinates in the same order as in the VDU28 command, (see User Guide page 387). You also give the first letter of the colour required, such as "G" for green. In order to leave room for control codes, you must not print any text within one space to the left or right of each vertical line, but you can print text immediately above or below the horizontal lines. For the same reasons, X1% must be at least 1, and X2% must be less than 38, but Y1% can be as low as 0, and Y2% can be as high as 24. Do not try to make the box very small, or strange things may happen! In this example, I have defined the entire usable space inside the box as a text window, so try LISTing the program as soon as you have run it. Thanks to Andrew G8YHI for bringing the original of this Procedure to my attention. 10 MODE7:PROCbox(5,12,34,6,"G") 20 PRINTTAB(13,9)"THIS IS A BOX" 30 VDU28,7,11,32,7:END 100 DEF PROCbox(X1%,Y1%,X2%,Y2%,C$):LOCAL C%,Y%:X1%=X1%-1 110 C%=144+INSTR("RGYBMCW",C$):VDU31,X1%,Y2%,C%,55 120 REPEAT VDU96:UNTIL POS=X2%:VDU107,135 130 FOR Y%=Y2%+1 TO Y1%-1 140 VDU31,X1%,Y%,C%,53,135,31,X2%-1,Y%,C%,106,135:NEXT 150 VDU31,X1%,Y1%,C%,117:REPEAT VDU112:UNTIL POS=X2% 160 VDU122,135:ENDPROC