Interacting with StrongED

StrongED does not provide many * Commands. However it includes a module Dialog which implements *Message

There are four commands which are accepted by *Message:

  1. StrongED_OpenDoc
  2. StrongED_OpenView
  3. StrongED_ExecCmds
  4. StrongED_ExecFile
These names are pretty-much self-explanatory and must be followed by the relevant file, view, commands etc. that are to be opened or executed. They can normally only be used from an Obey file or a Task window. If running in a Task window gives an error Window Manager is currently in use then StrongED needs updating. See the note below.

StrongED_OpenDoc and StrongED_OpenView

The formats of these messages are:
StrongED_OpenDoc <filename> <parameters>
StrongED_OpenView <parameters>

The StrongED_OpenDoc message is used to load a file into StrongED.
The StrongED_OpenView message is used to create additional views on a text which has been opened by StrongED_OpenDoc. It always relates to the last StrongED_OpenDoc message received.

You can store the messages in an obey file by prefixing each line with 'Message'. Which is a *command implemented by the Dialogue module that comes with StrongED. It's purpose is to convert the remainder of the line into a Wimp message that's then sent to StrongED.

Both messages understand the following parameters:

Parameter Value Meaning
-x0 <num> x coordinate of top left corner
-y0 <num> y coordinate of top left corner
-w <num> width of a view
-h <num> height of a view
-scrollx <num> x scroll offset
-scrolly <num> y scroll offset
-wordwrap if present, word wrap is on
-charwrap if present, character wrap is on
-autowrap if present, auto wrap is on
-wrap <num> wrap width of view in characters
-iconised if present, view is iconised (actually it's hidden)
-offset <num> cursor offset in bytes from start of text
-ftyp <num> 3 digit hex filetype of file displayed in view
-readonly if present, text is write-protected
-mode <name> mode used in the view
-m1 <num> mark position 1, offset from start of text
-m2 <num> mark position 2, offset from start of text
-m3 <num> mark position 3, offset from start of text
-m4 <num> mark position 4, offset from start of text
The items marked in bold may have their keywords omitted, but must then be given in the right order.

StrongED_ExecCmds and StrongED_ExecFile

StrongED_ExecCmds executes commands consisting of a string of StrongED functions with their parameters which are executed sequentially. This is very much like the list of functions/commands tied to a key in a ModeFile.

For example, the following will insert the current date at the start of a view: StrongED_ExecCmds StartOfText DateAndTime("%CE%YR-%M3-%DY") Newline

You can either prefix the line with 'Message' and put it in an obey file (see Loading files from a list) or send it directly from an application by building a message block and passing it to StrongED.

The message block should have the following format:

+0 message length (rounded up to a multiple of 4)
+4 handle of sender (filled out by Wimp)
+8 my ref (filled out by Wimp)
+12 your ref (should be 0 as it's the original message)
+16 message code, &43B00
+20 message data, StrongED_ExecCmds <list of commands>

If you want to execute lots of commands then you can put them in a file and send the message StrongED_ExecFile with the path of the file as its argument. StrongED will then execute all the commands in the file.

Note on StrongED Messages in a task Window

The *Message command is executed by the Dialog OS module which sends the message using Wimp_SendMessage. This needs a wimp task to do that, so it starts one. You can't do that inside a TaskWindow so the error message is given. However a new Dialog module has been produced which is included in recent StrongED - !StrongED.Tools.Dialogue, dated 98h of December, 2019 or later. If this module is present messages can then be used in a task-window.

Was this page helpful? Please email me and/or rate this page:

If you want a reply make sure any email address will not get spam-binned!
Optional comment

Other relevant pages