index   prev   next RISC OS Notes


documentation - ADFS::HardDisc5.$.DOCZ.stronged There are references throughout this cookbook to StrongED - this section is mainly for info on internals, configuring and search
wrap and unwrap is in menu Basefile

# mode syntax

see ADFS::HardDisc5.$.DOCZ.StrongED.ModeDocs and StrongED Help

# to make a new mode

move to desk frED shift-! on ibar - opens userprefs dir open Modes dir >>menu > new directory > JR2 - drop on UserPrefs.Modes copy a mode file into JR2 and modify description to suit new mode. **** but from fred .... Please don't advise users to go into UserPrefs or Defaults directly to change the BaseMode ModeFile. The proper way is to click Ctrl-Adjust over the iconbar icon, that way they'll always load the active BaseMode ModeFile. There is also no need to copy the file from Default to UserPrefs prior to editing it. When StrongED detects that it's one of its Default files that's being saved it will offer you to save it to UserPrefs. StrongED will automatically create a directory if required. You should always choose 'Save to UserPrefs' unless you have very compelling reason to alter the Default copy (eg you're me and are preparing a new release of StrongED ;-).

# syntax characters for mode html

..... group1 <head> group2 <h1>but not in between</h1> group3 <em> group4 <form > group5 <input xxxx=hhh> group6 <img src="hhhh.ggg" > group7 <script > group8 <map> .....

# load multiple files from a directory

hold ctrl and drag directory to ib-icon ... <list of filetypes>, <Pattern to match filename against> filetypes are 3 digit hexadecimal numbers separated by spaces. Specifying '*' (sans quotes) matches any filetype. path match pattern is a string which can contain two types of wildcards. A single '*' matches any char but not a '.' while '**' matches all characters. A few examples will hopefully make things clear. To load all files you use: *, ** To load all Basic files use: ffb, ** To load all html files use: faf, ** To load all files in subdir x: *, **.x.* Finally a couple more advanced (if maybe silly) examples. To load all HTML, Obey files with 'x' in the name: faf feb, **.*x* As above but only if inside a subdir named 'y': faf feb, **.y.*x* > But I cannot work out how to load all files of type PDream. > As I want to load all files - Pattern = blank? =* =??? The pattern 'DDE, **' (without the quotes) should load all PipeDream files in the directory dragged to the iconbar icon, including those in subdirectories.

# project organiser

There's already a kind of project organiser; the List-of-Windows window. Load all the files in your project, then c-L to open LoW and click Menu over it. Open the Save submenu (make sure Selection is unticked) and save it somewhere convenient. Next time you want to work on the project double-click the saved file to load all your files. You can do this for as many projects as you like, and if you re-save the LoW each time you end a session then all view positions, cursor positions, marks, etc will be restored next time you open the project.

# Run StrongED from a command line

Use Message StrongED_OpenDoc eg (all on one line): MESSAGE StrongED_OpenDoc ADFS::HardDisc5.$.DOCZ.NoteBook.Cook 18 2340 1490 1248 0 360 -wrap 100 -offset 77 -mode JR You can make this a psuedo app to be runn by double click as follows: create a directory !dir save the above line in !dir with name eg. openup and type Obey. create a Run file in !dir with the command: Filer_Run .openup

# Key bindings

set current directory using stronged ctrl shift tab and mouse pointer ^⇑Tab SetDir ^⇑F9 open chars window ⇑F9 Learn F9 Playback ^D,^D DateAndTime ("%DY.%MN.%YR") ^D,^T DateAndTime ("%24:%MI") ^F Find word in this text ^⇑F Find word in all text ^W,^C CreateView ^W,^V SplitViewVert ^W,^H SplitViewHor ^W,^F FullView ^W,^S ScaleView see "Quick reference" in StrongED help for more key shortcuts see basemode file for all key shortcuts (^Adjust on icon) note shortcuts are invoked by two quote chars followed by char. eg ``b produces <b></b> in html mode the Mode help in basic shows the shortcuts for basic Which keys are intercepted by StrongED is controlled by the TaskWindow mode. Keys that are not to be intercepted should be in the KeyList with the ToTask function assigned to it. In this case: KeyList c-C ToTask End In the ModeFile this is commented out in favour of BlockCopy support. So it's just a matter of restoring the original key binding.

# Config

Changes should go in StrED_cfg, which can be placed in Boot.Choices, where they will be safe from upgrades to StrongED. StrongED$Mode = jr at start of file to set mode to jr StrongED$Wrapwidth = 132 at start of file to set its width in StrongEd. Set wrapwidth to automatic by selecting the "80" at bottom of window s^L sets width to longest line in file use >>Edit>Unwrap to fix textline length

# html

Move Modewhen file from ADFS::HardDisc4.$.Apps.S1.!StrongED.Defaults.Modes.HTML to ADFS::HardDisc4.$.Apps.S1.!StrongED.Defaults.Modes.StrongHTML to make StrongHTML default (then close and restart Stronged) also change Security setting to allow modeinit to run (ctrl-! for window)

# MODE - make a new mode file:-

choose a folder from ADFS::HardDisc4.$.Apps.S1.!StrongED.Defaults.Modes that is similar to the mode you wish to create. (External is pretty minimal) copy it to ADFS::HardDisc4.$.!BOOT.Choices.!StrED_cfg.UserPrefs and rename it to the name of the mode you wish to create open and modify to suit. You can change the strhelp file in by shift double click - this exposes a text file called !Root which can be edited. note the first line is used as the window title. See stronghelp manual for more. (NOTE v4.64)Help -in ! ...Messages contains mode help entries - you have to modify it directly as it is ignored if put in User area StrEd_Cfg find the line below in the Messages file # Help for mode-specific toolbar entries and menus > My jpegs are in a dir and can be displayed by the filer in Date > order. > > What I want to do is to list them out to a text file in same > order. Select the files, then shift-drag the selection into an open StrongED window. The full pathnames will be listed in the current filer order. > This could then be turned into an obey file to rename them with > numeric prefixes. Files could then be processed in name sequence.

# Is there an easy way to apply a series of search and replace strings

Yes. Use StrongED and drag in a script like this, with the replace table appropriately modified (presuming you have !lua filerbooted).

#! lua

-- multiple search and replace local replace = { -- edit this table ["seperate"] = "separate"; ["supercede"] = "supersede"; ["kernal"] = "kernel"; ["old rubbish"] = "snappy phrase"; } -- search for string in square brackets, replace with -- string between equal sign and semicolon. local transform = \(x,y) for old,new in pairs(y) do x = x:gsub(old,new) end -- for => x end -- function local f =[1],"r") local s = f:read "*all" f:close() io.write(transform(s,replace)) -- Gavin Wraith (

# An application launcher using StrongED

Developed with help from Fred Graute, StrongED maintainer and CSA.Apps Usenet contributors. Step 1 - Customising StrongED Define search terms in your UserPrefs copy of the StrongED BaseMode mode file. If you haven't got a copy, make one by copying from Defaults Search Filename "ADFS::" {~(Ctrl|White) Any}+ App < * "!" {~"." Any}+ > notreadme ~"readme" {Any}6 > End Define an entry for the double-click application launch:- ClickList Select2 Filename Run("Filer_Run <StrongED$Tmp_MarkWord>") End Define an entry for shift double-click to open an application:- ClickList s-Select2 Filename Run("Filer_OpenDir <StrongED$Tmp_MarkWord>") End Step 2 - Creating the App List. Use !EnumDir (Mike Hobbs) to enumerate the top-level directory that contains your applications eg. ADFS::HardDisc4.$.Apps Save the output to file - this will create a CSV file called Apps Set the Type of file to Text for editing and open in StrongEd. Use the F2 search window, set to Advanced, with a search term of - App - this uses the search string defined above and produces a ListOfFound which contains a line for each application plus a few lines that you don't need. Save this ListOfFound as a file - templist. Open templist in StrongED and use the F2 Advanced search with the search term - notreadme - as defined above. This removes the !Readme files from the list of applications. Save the listOfFound window as !AppList in the Apps folder. Step 3 - Using the App List. Make a convenient shortcut to !AppList. I put mine on the icon bar at boot time using AddTinyDir in the Desktop obey file. Open !AppsList with StrongED. Find the application you wish to launch, by inspecting the alphabetically ordered list or by using the search facilities of StrongED. Double clicking anywhere on the line containing the fully qualified app name. If you prefer you can open the application directory by holding down shift and double clicking. What next? The above process is a bit long- winded, but once you have made the changes to the modefile you can produce a new !AppList in a few minutes. However, while developing the above technique I received an email from Gavin Wraith suggesting that the job could be done easily by using scripting language in conjunction with StrongED. This looks interesting so I will give it a go using AWK.

# StrongHelp

see ADFS::HardDisc4.$.DOCS.StrongHelp.readme see StrongHelp Manuals Stronghelp note path for standalone manuals is Helpdata$Dir don't know how it is set originally - use reporter to find out !Manuals will not reset Helpdata$Dir if it is set already

# Define a key to replace tab by comma

Tying this S&R to a key is easy. Open the modes menu by clicking Adjust on StrongED's iconbar icon. Click Shift-Select on the name of the mode in which you want to add the keypress. In the ModeFile opened, find the KeyList (if it's BaseMode then find the main KeyList). Pick a suitable key combination and assign it the following: Replace("\t",",",Text,NoLine,NoCase) Save the file when done and the new keypress should be available.

# Define a key to replace many new lines with one

In order to do this you'll need to add a search pattern to the Search section of the relevant ModeFile. You'll also need to a Replace pattern to the Replace section. Finally you'll need to add a binding to the KeyList, the main KeyList if you want to add it to BaseMode. (Fred) I'm going to assume it's BaseMode you want to alter. Ctrl-Adjust-click on StrongED's iconbar icon to load the BaseMode ModeFile. Then click on the LoF icon on the toolbar to get a list of various sections in the ModeFile. Click on the 'Search' line in the LoF to move to that section and add the following line: ManyNewlines {\n}+ Next move to the 'Replace' section and add this line: SingleNewline \n Finally, click on the 'KeyList' line in the LoF, find the line that defines ctrl-tab (^Tab) and replace it with: ^Tab Replace(ManyNewlines,SingleNewline,Text,NoLine,NoCase) Now save the file (to UserPrefs if it's not already there) and you should have it working.

© JR 2013