130. Coloured text and backgrounds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Changing colours using BASIC is a simple operation; the statement VDU19,1,2,0,0,0 will change the text colour to green in all modes except Mode 7. The same effect can be achieved by holding down the key and typing S12000 . When using VIEW the VDU command is not available, although the sequence will work. Neither of these methods will work in THE Watford Electronics Disc Sector Editor, for example; the only way to change colours here is by the *FX155,X operating system command which is rather complex. *FX155,X writes to register 1 (palette) of the video ULA, but in two-colour modes the command must be used 8 times with different values of X, just to change the text colour, and a further 8 times to change the background colour. (See The Advanced User Guide sections 19 and 22.) The program below calculates the values of X for each foreground and background colour and transfers them onto disc as files. Before running the program make sure there is space for 16 small files on the disc; 8 files will be named as in the DATA statement in line 30, and 8 with the same names prefixed with the letter B. You can then delete any files that you feel you will not need. When using VIEW for example, entering *EXEC BLUE followed by *EXEC WHITEB will give blue text on a white background. If you are NOT using the old BASIC-I on a BBC B, you can omit lines 500-530 and replace the PROCoscli in lines 40 and 80 with the keyword OSCLI . 10 DIM colour$(7) 20 FORI%=0 TO 7: READ colour$(I%): NEXT 30 DATA BLACK,RED,GREEN,YELLOW,BLUE,PURPLE,CYAN,WHITE 40 FORI%=0 TO 7: PROCoscli("SPOOL "+colour$(I%)) 50 FORJ%=8 TO 15: PRINT"*FX155,";16*J%+I%: NEXTJ% 60 *SPOOL 70 NEXT 80 FORI%=0 TO 7: PROCoscli("SPOOL "+colour$(I%)+"B") 90 FORJ%=0 TO 7: PRINT"*FX155,";16*J%+I%: NEXTJ% 100 *SPOOL 110 NEXT 120 END 500 DEFPROCoscli(Z$) 510 $&C00=Z$ 520 X%=0:Y%=&C:CALL&FFF7 530 ENDPROC