13. Status functions ~~~~~~~~~~~~~~~~ The first is a useful Function which can be used to test the status of various aspects of the VDU drivers. For example, to check if the screen is in paged mode, then use IF FNstatus(2)=TRUE THEN... To check whether there is a text window defined, then use IF FNstatus(3)=TRUE THEN..., and so on. You can achieve the same result, though not in a proper Tube-compatible way, by Peeking location &D0. Indeed, the only way I know of disabling scrolling, (bit 1), is to directly Poke &D0 with ?&D0=?&D0 OR 2. (Enable it again with ?&D0=?&D0 AND 253.) The second Function returns the current graphic Mode number, and the third Function returns the ASCII code of the character at the present cursor position. You can move the cursor to the required position with PRINTTAB(x,y); or VDU31,x,y. 100 REM ** Returns TRUE if Bit is Set ** 110 : 120 REM 0 - Printer enabled by VDU2 130 REM 1 - Scrolling disabled 140 REM 2 - Page Mode enabled by VDU14 150 REM 3 - Text Window defined by VDU28 160 REM 4 - Not used 170 REM 5 - Text/Graphics cursors joined by VDU5 180 REM 6 - Edit cursor in use 190 REM 7 - VDU drivers disabled by VDU21 200 : 210 DEF FNstatus(bit%):LOCAL A% 220 A%=&75:=-(((USR&FFF4 AND &FF00)DIV&100)AND2^bit%)DIV2^bit% 100 REM ** Returns Graphic Mode ** 110 : 120 DEF FNmode:LOCAL A% 130 A%=&87:=(USR&FFF4 AND &FF0000)DIV &10000 100 REM ** Returns Character at 110 REM flashing cursor position ** 120 : 130 DEF FNchar:LOCAL A% 140 A%=&87:=(USR&FFF4 AND &FF00)DIV &100