[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] startup parameters for StrongED



In message <f0e891dd50.jr@xxxxxxxxxxxxxxxxxxxxx>
          rickman@xxxxxxxxxxxxx wrote:

> <f3c744dd50.fjgraute@xxxxxxxxx>
>           Fred Graute  wrote:
>
> > 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.
>
> Fred - thanks for the clarification.
>
> Is is possible to use *message to send other commands to an open
> StrongED - Eg search and replace?

Yes, you can use the messages StrongED_ExecCmds and StrongED_ExecFile.

StrongED_ExecCmds has as its argument a string containing the commands
to execute. This is very much like the list of commands you tie 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
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.

There is also the 'OnLoad' keyword that can be set in a mode's ModeFile.
Any commands tied to it will be applied when a file is opened in that
mode. You could, say, tie the command 'EndOfText' to 'OnLoad' to have
the caret moved to the end of a text immediately.

Cheers,

Fred.

-- 
StrongED developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx