|Version 3 (modified by AmigaPhil, 14 months ago) (diff)|
WriteEditor -- Pass an ARexx command to the internal editor. (V2.0)
Passes an ARexx command to the internal editor to act upon the contents of a given Write window.
Quoting the TextEditor.mcc class autodoc, the following commands are currently supported:
GOTOLINE Template: /N/A
GOTOCOLUMN Template: /N/A
CURSOR Template: Up/S,Down/S,Left/S,Right/S
LINE Template: /N/A
COLUMN Template: /N/A
NEXT Template: Word/S,Sentence/S,Paragraph/S,Page/S
PREVIOUS Template: Word/S,Sentence/S,Paragraph/S,Page/S
POSITION Template: SOF/S,EOF/S,SOL/S,EOL/S,SOW/S,EOW/S,SOV/S,EOV/S
SETBOOKMARK Template: /N/A
GOTOBOOKMARK Template: /N/A
TEXT Template: /F
GETCURSOR Template: Line/S,Column/S
MARK Template: On/S,Off/S
Refer to the Amiga User Interface Style Guide for more info about these commands.
Please note that because of the internal use of the ReadArgs() function, the ARexx Host requires to escape certain special characters like a newline (0x0a) or escape character (0x1b) if you want to pass it i.e. with an TEXT command to the texteditor.
This means that you have to use the following escape sequences in your provided strings:
*N substitutes to 0x0a
*E substitutes to 0x1b
** substitutes to *
*" substitutes to "
Please have a look at the examples below for a short example on how to use these escape sequences properly.
VAR/K - alternative variable to put the results into instead of RESULT
STEM/K - base name used for the stem where the result will be stored
COMMAND/A - the command string to be passed
VAR - info returned by the query
<STEM>RESULT - results of the command, if any
RC is set to 10 if no Write window was previously specified as "active" with MAILWRITE ?.
/* Enable result codes */
/* Start a new mail */
MAILWRITE STEM st.
win = st.window
/* Edit the Write window */
MAILWRITE WINDOW win
'WRITESUBJECT "I don't think I can go to work today"'
/* Clear the editor */
/* Write some text into the editor */
'WRITEEDITOR "TEXT Sorry, but I am sick today!"'
/* Write some text containing a newline (*N) */
'WRITEEDITOR "TEXT Hello Joe,*N I would like to meet you."'