SB BBC @ GBR Oldie hints/tips #080-083 Hints and tips from the archives of Wakefield BBC Micro User Group... 80. Text screen dump ~~~~~~~~~~~~~~~~ This Procedure enables you to dump the entire text from the screen onto your printer. It will work in any Mode from 7 up to 0, and is called by specifying the number of columns and lines; eg. PROCdump(40,25) for Modes 6 and 7. Any Mode 7 teletext control codes will be printed as blank spaces, and graphics in other Modes will be ignored. Only text which has been printed in normal character positions will be printed; any which was printed with the aid of VDU5 and MOVE will not show. If your printer has an enlarged-print facility, you might like to insert the appropriate control code in lines 1015 and 1055 for dumping Modes 2 and 5; the code is VDU14 for the Epsons. If you want to be very posh, you can extend the Procedure so that it sorts out what screen Mode is in use automatically, with the aid of the Function given in an earlier tip. Note that you should omit line 1050 if your printer does auto linefeeds after a carriage return, and that the setting of the *FX6 option has no effect on the dump Procedure. The little FNpeep at the end may be used independently if required; it returns the ASCII code of the character at screen position X,Y. Eg. A$=CHR$(FNpeep(12,15)) would make A$ equal to whatever character was in column 12 of line 15, and would leave the cursor at that position. 1000 DEF PROCdump(width%,depth%):LOCAL X%,Y%,ascii% 1010 VDU6,26,4,2 1020 FOR Y%=0 TO depth%-1:FOR X%=0 TO width%-1 1030 ascii%=FNpeep(X%,Y%):IF ascii%<32 OR ascii%>126 THEN ascii%=32 1040 VDU1,ascii%:NEXT X%:VDU1,13 1050 VDU1,10:REM Omit if printer has auto linefeed option. 1060 NEXT Y%:VDU3,30 1070 ENDPROC 1080: 1090 DEF FNpeep(X%,Y%):LOCAL A% 1100 VDU31,X%,Y%:A%=&87:=(USR&FFF4 AND &FF00)DIV &100 81. Booting up secondary drives ~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is very simple to Boot up disc drive 0, by pressing , but you cannot usually do this with, say, drive 1. (Some independent DFSs do allow this, but not Acorn ones.) However, there is a way, which works as long as you have a disc in drive 0 as well. Just insert this routine at the start of whatever program the !BOOT file CHAINs - eg a menu utility. All you do to Boot up drive 1 is to Boot up drive 0 as normal, but hold onto the key just a little longer than usual, until you see drive 1 start up. Do release the key as soon as drive 1 starts up, or it may go into a harmless loop until you do let go. Needless to say, if you have a double-sided drive, then this works just as well for drive 2 instead of 1. 95 IF INKEY(-1)=0 THEN 100:REM Test for . 96 *DR.1 97 *EXEC !BOOT 98 END:REM You need this! 100 REM Start of main program. 82. Building !BOOT file ~~~~~~~~~~~~~~~~~~~ Those of you with disc drives will know that it is sometimes not possible to use *BUILD without the "disc full" message being issued, even though the disc still has quite a bit of room on it. This is because the DFS, not being telepathic, has no advance knowledge of how long the file will be, (only you know that), and tends to assume that it will need lots of space on the disc. One way round this problem is to *BUILD the file on a spare disc, and then *COPY it across. A more convenient method is to save a dummy !BOOT file onto the disc first. The most convenient and safe way of doing this is to use *SAVE !BOOT 0 1. This saves a dummy file of length one byte onto the disc, so as to get the filename "!BOOT" onto the catalogue. You should then have no difficulty in *BUILDing your !BOOT file afterwards, in the normal way. Note that this method will not corrupt any files in memory, and it can safely be used from BASIC, View, Wordwise etc.. This technique works equally well when you wish to use the commands *SPOOL or OPENOUT/UP, but get "Disc full" messages. 83. Can't-extend errors ~~~~~~~~~~~~~~~~~~~ The annoying message "Can't extend" is sometimes issued by the DFS when replacing an existing file with a longer version of the same name. This is because the file is 'sandwiched' in by others on the disc, and can't 'grow' any further. You can often overcome this by using *DELETE to remove the existing file, and then Saving the new version. The reason for this is that the DFS now puts the file after all the others on the disc, instead of trying to put in back in the original 'slot'. However, if you get the message "Disc full", you will have to save the file on a spare disc, *COMPACT the original one, and then try and fit the file back on with *COPY. Yes, the Beeb DFS really is rather thick I'm afraid; intelligent DFS's take care of all this disc 'Housekeeping' automatically. 73 Rick G4BLT @ GB7WRG