Acorn User


The Basic Editor

Author: Bruce Smith
Publisher: Acornsoft
Machine: BBC Model B

 
Published in Acorn User #040

A not-so-basic editor

The Basic Editor

This 16K ROM has been a long time coming, and I must say I'm surprised no-one has been tempted to take the bull by the horns and beat Acornsoft to it long ago. As it happens, the story of this ROM is of two young lads turning up on the doorstep in Cambridge spinning a "Wanna buy a ROM, mister?" line. Their trip was obviously worthwhile and anybody who does his or her fair share of Basic or Assembly Language programming should read on.

The idea of the Basic Editor is that effectively turns your BBC Micro into a Basic program wordprocessor, offering all the facilities of a wordprocessor. The most obvious of these are the ability to scroll in any direction through a program - inserting extra commands at the position of the cursor - and the very useful search and replace utilities. There are of course many other goodies in the package, as we shall see.

Like many of Acornsoft's ROMs these days, the Basic Editor is a dual screen affair. Typing *BE places you in the Editor in a Mode 7 command screen. The length of your program and the amount of memory remaining is displayed. From here you can enter any of the 29 editing commands.

Pressing the Escape key toggles you into the edit mode screen which, as it implies, is where you write and edit your program. Programs can be loaded and saved in the normal manner, but the program itself is displayed slightly differently. Line numbers descend down the left-hand side of the screen, and the Basic text that follows them is justified a space to the right of each line number giving a very clear uncluttered display.

By default the edit mode screen is mode 7 by this can be changed simply by Escaping to Command Mode and selecting the desired screen mode. Once in a non-teletext mode you can also define foreground and background colours. White characters on a blue background are selected by default, which I find by far the best display.

When in edit mode the function keys can be used to execute a variety of functions, used by themselves or with SHIFT and CTRL like View. Just about every feature I can think of has been included here. For example, CTRL-f3 will add the line below to the one the cursor is sitting on. Conversely, CTRL-f2 will split the statement(s) after the cursor onto a new line below.

Using the SHIFT and CTRL keys in conjunction with the cursor keys allows you to move through your program rapidly in any direction. You can also mark a particular line (CTRL-f0) and jump to it instantly by pressing CTRL-f1.

New lines can be inserted anywhere into a current program simply by pressing the RETURN key at the appropriate point. The new line will be inserted below. The line number is normally one greater than the one above, except where this would be identical with the one below, in which case the whole program is renumbered. This is quite acceptable but I found it a bit of a pain when editing Basic programs for inclusion in Acorn User, mainly because most authors refer to line numbers in their articles!

When you have to use GOTOs in a program (GOSUBs are never necessary) then labels can be used to determine the destination of the command. For example:

   GOTO @ end

The destination line should contain the same label after a REM, i.e.:

   REM @ end

The command NUMBER will convert labels to their specific line numbers.

When in Command Mode, all commands can be shortened to two letters or even one, with no full stop. Commands such as LOAD and SAVE do not require quotes around filenames. A full, detailed helpsheet on the Command Mode commands is available at the touch of the H key. Figure 1 shows the dumped screen. INFO provides the low-down regarding the facts on the edit mode status and the program currently under scrutiny.

If you use a procedure library (and we all do, don't we?) the programs can be tacked onto the end of one another with the APPEND command. If any line numbers are duplicated then the two programs are intelligently renumbered to form one consecutively numbered program.

There are four commands associated with searching for strings. All will search for text in the form of variables and print display material and Basic commands, thus they are capable of reading and comparing Basic command tokens. The first of the quartet is FIND, which will display all the lines containing the string specified after it, i.e.

   FIND "GCOL0,1"

EDIT is somewhat similar but allows you to edit the line where the string is found. Pressing f5 moves you on to the next occurrence of the string.

CHANGE is a global search and replace command. Thus:

   CHAIN "sillynamevariable","finish"

will change all occurrences of "sillynamevariable" to "finish".

QCHANGE is the selective counterpart of CHANGE. In this case when the search string is prompted you are asked if you wish to change it or not. Pressing 'Y' does the business for you; pressing 'N' will leave the search string intact. In both cases, the next occurrence is sought.

All in all, the range of facilities that the Basic Editor provides are wide and most comprehensive. The only major omission that springs to mind is a partial renumbering command. While not being an absolute must, and when you write programs the line numbers should not really be of any importance, the inclusion of such a command world, in many instances, have made lots of the Basic toolkit-type ROMs obsolete.

The only other observation I would make is that for a 16K ROM it does seem a little light in content. However, having said that, at £29.90 inclusive of VAT this is undoubtedly one of those ROMs that you should have. Very useful.

Bruce Smith

Other BBC Model B Game Reviews By Bruce Smith


  • Castle Quest Front Cover
    Castle Quest
  • Repton Front Cover
    Repton
  • Phantom Combat Simulator Front Cover
    Phantom Combat Simulator
  • Castle Quest Front Cover
    Castle Quest
  • Hopper Front Cover
    Hopper
  • Repton 2 Front Cover
    Repton 2
  • Gold Digger Front Cover
    Gold Digger
  • Canyon Front Cover
    Canyon
  • The Secret Diary Of Adrian Mole Front Cover
    The Secret Diary Of Adrian Mole
  • Maze Front Cover
    Maze