SB BBC @ GBR Oldie hints/tips #100-102 Hints and tips from the archives of Wakefield BBC Micro User Group... 100. Printer routine snag ~~~~~~~~~~~~~~~~~~~~ If you wish to send text to the printer only, (ie with nothing appearing on the screen), there are two simple ways of doing it. You can precede the text with VDU2,21 , and follow it with VDU6,3 . Alternatively, you can precede it with *FX3,10 , (or *FX3,9 in the case of RS423 printers), and follow it with *FX3,0 , (or simply *FX3). In the latter case no VDU2 or VDU3 is necessary, and in both cases the character set by *FX6,- is not sent to the printer. This character is ASCII code 10, (linefeed), by default, and is usually set to 0 with *FX6,0 if your printer doesn't do auto-linefeeds. This is fine until you try sending a string of VDU codes, such as for the Greek characters shown earlier. Depending on the setting of *FX6,- , either 10's or 0's will not be sent to the printer, with all sorts of unpredictable and horrible results. Eg VDU27,10,3,4,0,0,3 would effectively be sent as VDU27,3,4,0,0,3 or VDU27,10,3,4,3 ! Now since 0's tend to appear much more often than 10's in VDU statements, those of you with printers doing auto-linefeeds are less likely to have trouble, but even so, this can be a considerable nuisance. There is a further snag with using VDU2,21 , and that is that if a 6 should appear in the VDU codes, then the VDU drivers are turned back on again too early, nasty things will happen on the screen, and the whole thing will probably seize up. The safe solution is to use VDU2 and VDU3 as normal, and precede each byte by 1; eg VDU1,27,1,45,1,1 , even though it is rather tedious. What would be nice would be to tell the Beeb to send all characters to the printer, but unfortunately, *FX6,- does not allow this to be done. 101. Second processor hints ~~~~~~~~~~~~~~~~~~~~~~ When you are using the 6502 2nd processor, in BASIC or with View, Wordwise etc., you can safely use the disc commands *BACKUP, *COMPACT and *COPY without overwriting a file in memory. This is because the DFS uses the Beeb RAM for these operations, whereas your file is safely tucked away out of reach in the 2nd processor's RAM. 102. Speech procedure ~~~~~~~~~~~~~~~~ For those of you with an Acorn Speech system, here is a procedure to conveniently call up speech, without using a clumsy string of SOUND statements or DATA lists. Note that the word numbers must be passed as one long string, with separating commas if necessary. Actually, you can use this technique whenever you wish to pass varying length lists of parameters, to a procedure or function. You would simply use num% for something else other than SOUND in line 1030. 100 PROCspeak("241,246,252"):REPEATUNTILGET=13:REM Now press 110 PROCspeak("265,275,128,266,209,230,211"):END 120 : 1000 DEFPROCspeak(data$):LOCALcom%,num%:REPEAT:com%=INSTR(data$,",") 1020 num%=VAL(LEFT$(data$,com%-1)):data$=RIGHT$(data$,LEN(data$)-com%) 1030 SOUND-1,num%,0,0:UNTILcom%=0:ENDPROC 73 Rick G4BLT @ GB7WRG