StrongED logo

StrongED Home Page
- Experiment 1 -


Experiments with StrongED - 1

By Gavin Wraith

 

StrongED has been a popular text editor for RISC OS for three decades. It comes with a huge range of features.

The aim of this series, Experiments with StrongED, is to demonstrate how to create new features. Which version of StrongED you are using yourself should not matter very much. I am in fact using version 4.70a10.

StrongED uses different modes. When you click Select on StrongED's iconbar-icon an empty StrongED window opens in BaseMode, the default mode. upon which most other modes are based.

You can see a list of the modes available to you already if you click on the iconbar-icon with Adjust. But actually you can define your own modes, for your own special purposes, and this will be the first thing that we demonstrate here. We will call the new mode Trial. You could call it anything else, subject to the rules of RISC OS filenaming. Initially it will not have any special properties apart from those furnished by BaseMode. The point of it is to have something to experiment with.

  1. Click SHIFT-Select on StrongED's iconbar icon or, if you have version 4.70, click Menu on it and select Open config->UserPrefs. This opens the UserPrefs directory. Create a directory called Trial in UserPrefs.Modes.
  2. In it create an empty textfile called ModeFile.
  3. From the iconbar-icon menu click Rescan dir -> Modes.

You should now find that you have a new mode called Trial available. You should be able to change to it by selecting Change Mode from the submenu appearing when you select the bottom item of a StrongED window's menu.

Now suppose we want any textfile that starts with the phrase #! trial at the beginning of its first line to be loaded into the Trial mode on being doubleclicked. To ensure this create a textfile called ModeWhen in the directory !StrED_cfg.UserPrefs.Modes.Trial containing

Rules Include
  fff, ** ; _trial
End

Match
  _trial->---><"#!" {White} "trial"
End

The red characters indicate use of the tab key. This is an example of StrongED's command language, which is described in the Help files that come with StrongED. You will note that Trial mode looks exactly like BaseMode. To give it extra icons along the top or extra entries in its menus we will have to put something in its ModeFile. However, if you open a StrongED window in Trial mode, click Menu and go to

Trial->Open Choices

and save your choices you will see that the Trial directory in !StrED_cfg.UserPrefs.Modes has gained two files: Choices and ColoursStd. These store your choices. So even without giving Trial mode any extra functionality you can still use it to try out alternative effects.

BaseMode is the default mode. In fact I use a non-standard BaseMode because I do not use spell-checking or the Speech module and I prefer a minimalist user-interface to the maximalism of a jumbo-jet cockpit. It is a matter of personal taste.

The point is, StrongED lets you choose. I have been using a non-standard BaseMode for many years and through many versions of StrongED.

However, I realize that my own way of using StrongED is very different from other people's, so I am going to have to rely on plenty of feedback from them.

I tend to have only one or two StrongED windows open at a time - minimalism again. But some people have lots of windows open simultaneously. You can drag a directory of textfiles onto the iconbar icon and all will be opened. StrongED provides many facilities for searching, editing and moving between multiple files.

Valid HTML 3.2! RISC OS