SB BBC @ GBR Oldie hints/tips #154-156 Hints and tips from the archives of Wakefield BBC Micro User Group... 154. !BOOT file for ViewSpell ~~~~~~~~~~~~~~~~~~~~~~~~ During a demonstration of 3 spelling checker packages, ViewSpell by Acorn came out as the worst, mainly because there was a lot of work involved for the user with originally generating the text in View, calling up ViewSpell, doing a disc change, making the ROM work, another disc change, then back into View for the results of the check! Yes, done this way it can be a nightmare! I have only a single 80 track double-sided Cumana drive, hooked up to an Electron with 1770 DFS, (you may snigger but PAGE is always E00), and have configured my !BOOT file, placed on the master dictionary disc, to do most of the work, including searching a number of user dictionaries. The disc is set up in the following way. Place all the dictionaries on side 2 and the text file to be checked as "text" on side 0. You will tell the ViewSpell system where all these bits are by the use of the PREFIX statements in the software when setting up the !BOOT file. The 'line' numbers below are the ones which appear when you are *BUILDING the !BOOT file, so don't type them in! NB: Lines 10 and 11 refer to user dictionaries; yours will no doubt differ. Make sure you are able to call both View and ViewSpell from the existing system. Line 12 is a blank. This is where the system asks for a user dictionary, and if using the keyboard one would only press . The !BOOT file therefore does it for you. Also, the statement in line 16 sets View into Format and Insert modes; your version may differ and may need a small change. After you have built your !BOOT file, save your text as described above, and then !BOOT the disc. When the system has finished you will be presented with the 1st item of your document which is spelt incorrectly. This is where you take over again after all the hard work has been done! 1 *BASIC 2 MODE 6 (or MODE 7, but then leave out line 3 for text colour) 3 VDU 19,1,3,0,0,0 4 *SPELL 5 PREFIX M :2. 6 PREFIX U :2. 7 PREFIX T :0. 8 LOAD TEXT 9 CHECK 10 OTHERS 11 BAD 12 (Just press here) 13 MARK MARKER 14 MODE 3 15 *W. 16 SET FI 17 LOAD MARKER 18 SEARCH #! 155. Splitting large files ~~~~~~~~~~~~~~~~~~~~~ This program was written in order to split a very large word-processing file that was too big to fit into memory. (Any type of file can be split; not just text files.) This may happen if the micro which saved the data had a 6502 2nd processor, Shadow RAM, or some other means of gaining memory, whereas yours may not. The program splits large files into smaller ones, whose length in bytes is determined by the variable max% in line 10. You should substitute the name of the large file for "oldname", and the name of the smaller subfiles for "newname". The subfile names will be suffixed by "1", "2" etc, so you will be limited to 6 characters on an ordinary DFS. This program will split a file in mid-word, so if you don't want it to do that, you can replace the expression PTR#c2=max% in line 40 with (PTR#c2>=max%ANDg%=32) ; the brackets are very important. This will split the file at the first available Space, but if you put 13 instead of 32, the file will be split at the first available Carriage Return, which would usually be at the end of a paragraph. Many refinements could be added, and the program is rather slow, but it does the job. 10 max%=15000:f%=1:c1=OPENIN("oldname") 20 REPEAT:c2=OPENOUT("newname"+STR$(f%)) 30 REPEAT:g%=BGET#c1:BPUT#c2,g% 40 UNTIL PTR#c2=max% OR EOF#c1:CLOSE#c2:f%=f%+1 50 UNTIL EOF#c1:CLOSE#c1 156. INKEY(-256) command ~~~~~~~~~~~~~~~~~~~ This command does not appear to be documented in any of the official Acorn manuals. Instead of checking for a key being pressed, it returns a number which indicates the type of machine in use. This can be handy when writing programs which are to be used in several different types of machine. Eg, to avoid the *SHADOW command upsetting a standard Electron or BBC model B, whilst executing it on a B+ or Master/Compact, you could use IF INKEY(-256)>1 THEN *SHADOW1 The numbers are:- BBC B with new 1.00+ OS -1 (including 1.20) BBC B with old 0.10 OS 0 (obsolete!) Electron 1 BBC B+ 64/128 251 Master 128 253 Compact 245 and now: Archimedes (Arthur OS) 160 (obsolete) Archimedes/A3000 (RiscOS) 161 Acoen A5000 ??? 73 Rick G4BLT @ GB7WRG