Roger King
BaseMode
Situated within the StrongED application directory is a file named BaseMode. This is the mode that lies underneath any other mode provided by the application. This file sets up headers, footers, bitmap fonts, keyboard shortcuts, date structure and user-defined macros.
We will now examine sections of the BaseMode file, and alter some of the variables which have been supplied as standard. Before starting to alter the BaseMode file, be sure to make a copy of this file and store in a safe place. If you then make an error in entering data into the BaseMode file, you will have the original to hand. StrongED scans the BaseMode file each time that the application is loaded onto the iconbar. If there is an error in the BaseMode file, StrongED will fail to function correctly. A message is generated if an error has been encountered in the BaseMode file.
Transposing two characters
The screenshot below shows a small section of the BaseMode file. You will see that the command to transpose two adjacent characters is ^T, i.e. <ctrl-T>. Note that the line commences with a # character and is greyed out. This means that this particular keyboard shortcut is not currently available for the user.
Users of Impression will be familiar with the command <ctrl-shift-Q> to transpose two adjacent characters, so let us change StrongED's shortcut key to this particular key combination.
Start-up StrongED and double-click on the BaseMode file to load it into the application. Scroll down the file until you see the seven lines of data shown in the above drawing. Note that the shortcut <ctrl-shift-Q> is currently assigned to kill StrongED from the iconbar.
Place StrongED's cursor to the left of the Ctrl character (^) and drag the mouse right with the <select> button depressed until the Q character is reached. The three characters should now be highlighted in inverse video (white characters on a black background). Now place the cursor to the right of the ^T in the Transpose(-2) line, and delete the two characters. Press <ctrl-C>, and the inverse video block will be copied into position on the Transpose(-2) line. You will see that the ^�Q command still exists in this particular area of the BaseMode file - it is assigned to kill the StrongED application.
As two shortcut commands cannot be assigned the same key, it is necessary to put the Kill StrongED shortcut out of action (a dangerous key shortcut anyway, as the application will quit the iconbar without any chance of saving your work). Place the cursor to the left of the first tab setting of the KillStrongED line and type in a # character. This line will then be greyed out. The option to kill the current StrongED view (^Q) has also been rendered ineffective by placing a # character at the start of the line. Note that the ^S function, to change the case of the character at the cursor, uses the same shortcut key as Impression.
If you browse through the BaseMode file, you will see the shortcuts offered by other key combinations. If you alter any of these shortcuts, make sure that they are unique to a particular key assignment.
Once you are sure that the key assignment has been set up as shown in the diagram above, you can re-save the file to disc. The new shortcut will not come into action until StrongED is quit from the iconbar and reloaded again.
Date and time
Date and time formats are also held in the BaseMode file. As supplied, they are as shown:
The formatting of date and time strings follows the conventions laid down by Acorn Computers in their manuals. Issuing the command Ctrl-DD will insert the current date into a StrongED window. Ctrl-DT will enter the current time and Ctrl-DW will insert the current week of the year. My own preference for the date format is shown in the drawing below:
This will enter into a StrongED window the date as: 26th January, 1997
Macros
At the bottom of the StrongED BaseMode file is an area where macros (shortcuts) can be stored. The diagram below shows this area with a simple macro inserted. The construct of a macro is tab then the shortcut combination, another tab and finally the full string which you wish to assign to this particular macro.
A macro is a shortcut to a string that can be entered into a StrongED window. If you view the current macros supplied with StrongED when you receive the application, you will see that three or four macros have been set up to insert the programmer's name and address and email data into a StrongED window. You can, if you wish, delete these particular macros and install macros of your own choice. In versions of StrongED prior to 4.15, the definer used for the macro strings was the $ character, whereas, in versions 4.15 and later, it was been changed to the <`> character (immediately above the tab key on the keyboard). This has the advantage over the $ character in that the <shift> key does not have to be depressed64
to enter the start of the macro. However, you can select any character you wish to define the start of a macro, and even have different macros starting with different characters.
Macros may contain the formatting characters \n and \i (normally used together). The characters \n will cause a new line to be generated. The characters \i will generate an indent, providing that the macro has started from a tabbed or indented position on a line. This combined function is most useful for addresses.
You can add to this area of the BaseMode file as many macros as you wish. Each macro must commence on a new line. The only stipulation is that each macro must have assigned to it a unique shortcut string. A convenient macro for one's own name and address is `me. As soon as this macro is entered into a StrongED window, the macro will expand to display your name and address. Note that macros are case specific. In the above example, if you were to enter `Me, the macro would be ignored.
The Learn function
As well as macros, StrongED also offers a learn function. If you want to type the same string, repeatedly, into a text file, you can ask StrongED to learn the sequence of characters. The learning process is initiated by pressing the key combination <shift-f9>. The word 'BaseMode' on the Info Bar will then change to 'Learning'. You can then enter a text string of up to a maximum of 250 characters, including tabs and return codes. When you have finished entering your string, press <shift-f9> once more. This action informs StrongED of the end of the learn string.
Whenever you require the learnt string to be entered into the text, press <f9>. The text will be displayed exactly as formatted in the learnt string. Only one learnt string can be held in memory at any one time, so that it is more useful for the learn function to remember a really long string that you intend to use regularly within a document. For a short string, it is probably wiser to use StrongED's clipboard.
Headers and footers
At the top of the BaseMode file are two lines that are set up to print headers and footers. The supplied PrintHead function includes the full pathname of the file, and the date and time that the file was printed. The pathname is left-justified and date and time are right-justified.
The PrintFoot function will centre-justify the page number at the bottom of each printed sheet.
The option to print headers and footers on every document is controlled from StrongED's Mode Choices.Misc pane.
Bitmap fonts
Inside the StrongED application directory is a directory named Bitmaps. If you examine the contents of this directory you will see five sprite files displayed. They are named, in alphabetical order as: Ctrl, PC, Script, System and X. You may load these sprite files into Paint to examine them. You will see that there are two files in each sprite file window: 8*16 and 8*8. The 8*8 bitmap fonts can be used by StrongED in high resolution modes. This choice is obtained from the Mode Choices.Display pane.
The default bitmap font used by StrongED is System. This bitmap font is assigned near the top of the BaseMode file. You may like to change the bitmap variable in the BaseMode file to see the effect of using PC, Script and X bitmap fonts. On no account attempt to use the Ctrl bitmap font as the default. This font is only used by StrongED to display embedded Ctrl characters in foreign format files that are loaded.
StrongED's main menu
We will now explore the contents of StrongED's main menu.
The first option on the menu is the Misc choice. This is shown in the drawing below:
The first option relates to StrongED's Help application. Press <shift-f1>, or alternatively click the <select> button over the icon on the left-hand side of StrongED's toolbar, to load the application.
The Print option allows you to include headers and footers and also to set up the page width and length of the document you intend to print.
The File info box can be displayed with the key combination <ctrl-I>, or alternatively by pressing the key combination <shift-select>, over StrongED's Help tool. The File info pane is shown below:
This pane displays useful information about the file that you are currently working on. It also informs you of the last time that the file was saved to disc. Clicking <select> on the Count Words icon will inform you of the current word count of the document.
Pressing <shift-adjust> on StrongED's Help icon on the toolbar will inform you of the ASCII code (in decimal and hex) of the character under the cursor.
The next option on the Misc menu is Filetype. You can slide off this choice and alter it as required.
The next choice, <ctrl-shift-f9> will present on screen StrongED's character picker. This was described in part one of the series.
The last item on this particular menu will inform you whether the file you are currently working on is write protected or not. If owner and public read attributes have been locked previously, you will not be able to edit the file at all.
The save menu
Dragging the mouse to the right from this choice will display StrongED's save box. If a block of text has been marked, the Selection option will no longer be greyed out, and this can be set in order to save just the marked text. The default filename for marked text is 'block'.
The block menu
The first item on this menu displays keyboard methods of marking text within a document. The first choice, offered by key <f6> is to mark the start and end of a block. Simply place the cursor at the start of the required area and press key <f6>. Move the cursor to the end of the required area and press this key once more. The marked blocked can then be dragged to another area of the document or can be dragged out of StrongED into a filer window or indeed another application window.
This menu option also displays ways to mark certain areas of text. To mark a word under the cursor press <ctrl-A>. To mark the line containing the cursor press <ctrl-AA>. Finally, to mark the entire text press <ctrl-AAA>.
The second item on this menu displays a key shortcut to clear marks. This is achieved by the key combination <ctrl-Z>, or alternatively using the <escape> key.
The Process option from the Block menu offers eleven choices. The first six of these have keyboard shortcuts assigned to them. They are: Copy: <ctrlC>, Move: <ctrl-V>, Delete: <ctrl-X>, Upper case: <ctrl-U>, Lower case: <ctrl-J> and finally Swap case: <ctrl-s>.
The next option, Indent, permits a positive value to be entered into a writable icon in order to indent the block by that many spaces. A negative value entered into this writable icon and applied to the same block will remove the indent set previously.
Tabs to spaces will replace all tabs in a block with spaces. The next command will reverse this process.
The choice ROT13 will encrypt your StrongED block by adding 13 to the ASCII value of each character. You could then send this encrypted file to another StrongED user. He could then use the same command to decode your text.
The final choice on the Block.Process menu is the Sort option. This will sort the lines of a block into ascending order. You must include a LF or CR under the last line of the block for the sort operation to take place.
The final option on the Block menu relates to the Clipboard. The commands offered by this choice are: Copy to clipboard: <ctrl-shift-C>, Cut to clipboard: <ctrl-shift-X>, Paste to text: <ctrl-shift-V> and Purge clipboard: <ctrl-shift-Z>.