168. Drawing text boxes (for Master/Compact) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This Procedure makes use of the extra characters built-in to the Master. It enables you to draw a neat box round text, without resorting to graphics commands such as MOVE and DRAW. You specify the Left, Bottom, Right and Top TAB X-Y co-ordinates of the box, just as if defining a text window. The VDU28 command in line 1040 defines a text window inside the box, and can be omitted if not required. The example shown is in Mode 0, but it works in any 32-line Mode, ie 0/1/2/4/5, but will not look very nice in Modes 3 & 6 unless you make use of the "STRIPEY BACKGROUND" hint given in the 1986 tips compilation. 10 MODE0:PROCbox(20,20,60,10):END 20 : 1000 DEFPROCbox(L%,B%,R%,T%):LOCALV% 1010 PRINTTAB(L%,T%)CHR$(163)STRING$(R%-L%-1,CHR$(166))CHR$(165) 1020 FORV%=T%+1TOB%-1:VDU31,L%,V%,169,31,R%,V%,169:NEXT 1030 PRINTTAB(L%,B%)CHR$(170)STRING$(R%-L%-1,CHR$(166))CHR$(172); 1040 VDU28,L%+1,B%-1,R%-1,T%+1:REM Omit if not required 1050 ENDPROC