SB BBC @ GBR Oldie hints/tips #032-037 Hints and tips from the archives of Wakefield BBC Micro User Group... 32. Unwanted spaces ~~~~~~~~~~~~~~~ It is all too easy to leave unwanted spaces in listings, especially by "overshooting" the ends of lines when using the key. If you are short of memory, it is worthwhile editing out those spaces. You can spot them by redefining them as white blobs, and then using any Mode except 7, (6 is ideal). When you wish to remove spaces, type the following in directly in Mode 7, and then change mode. When you've edited out any unwanted spaces, change back to Mode 7 and SAVE the program. To restore normal spaces, type *FX20 . VDU23,32,126,126,126,126,126,126,126,0 33. Basic-1 and Basic-2 ~~~~~~~~~~~~~~~~~~~ In order to be able to check compatibility of programs, you may wish to retain the BASIC-1 ROM in your machine after obtaining BASIC-2. Simply put the old ROM in a lower-priority ROM socket, and switch to it when required with *FX142,n where 'n' is the socket number, (0 to 15). If you have a program in memory, then type OLD to recover it. Pressing will not cancel the change, but switching the machine off, pressing , or typing *BASIC will return to BASIC-2. Alternatively, you can use *FX142 to switch back to BASIC-2. 34. Lower-case commands ~~~~~~~~~~~~~~~~~~~ You will know that whereas VDU and PRINT are BASIC keywords, vdu and print are not. However, with the MOS 'Star' commands, *FX, *SAVE, *DELETE etc., lower-case is treated the same as upper-case. Thus *fx0 and oPt1,2 are valid commands. Further to this, disc filenames, though not cassette filenames, are treated in a similar fashion. Thus if you save a program as "sneaky", it appears in lower-case in the catalogue, but you can reload it as "SNEAKY" if you wish, and any attempt to save a program called "SNEAKY" would overwrite the lower-case one. 35. Saving memory ~~~~~~~~~~~~~ When you are writing very large programs, or ones that need a lot of variable space, every byte can count to squeeze as much as possible into memory. All BASIC keywords are 'tokenised' into just one byte each, so "RESTORE" only occupies the same amount of memory as "TO", ie one byte. However, this is not true of the MOS 'star' commands. Thus *O. occupies 3 bytes, whereas *OPT occupies 4, and so on. You can abbreviate words like *KEY, *DELETE etc also. However, it is wise not to abbreviate *DISC or *TAPE, as this does not not work on all versions of Operating System. 36. Simplified commands ~~~~~~~~~~~~~~~~~~~ In the case of operations starting with a '*', you can omit the quotes round a filename. Thus you must have LOAD "name", but *LOAD name is OK. In the same way, you must have CHAIN "name", but *RUN name or just *RUN is OK. You can use the abbeviation */ for *RUN, eg */ Myprog. 37. Tidy menus ~~~~~~~~~~ A tidy way of producing a program 'menu', without a lot of repetition, is to use DATA lists. In the example below, the GOTOs in line 130 are just for demonstration purposes. You would obviously put in the line numbers appropriate to your own program. The line number after RESTORE is the one where the DATA list is stored. You can actually put the DATA list anywhere you like in the program, even in the first line, as long as the RESTORE statement points accordingly. Don't be tempted to write this in the form of a Procedure, as the GOTOs will cause nasty things to happen! 100 CLS:PRINT'TAB(18)"MENU"'TAB(18)"----"' 110 RESTORE 2000:FOR A%=1 TO 5:READ A$:PRINT TAB(4);A%"........."A$:NEXT 120 PRINT'"Select desired option No. "; 130 ON VAL(GET$) GOTO 200,300,350,400,480 ELSE 130 2000 DATA Start Again,Exit Program,Change Details,Display Details, Action Replay 73 Rick G4BLT @ GB7WRG