X2 provides the capability to define your own commands through a macro facility. Macros must be written in Rexx, and have a file extension of .X or .CMD. If your macros are installed somewhere on your PATH, they can be invoked directly by simply typing the macro name. If not on your path, the path to the macro must also be specified.
X2 supports Classic and Object Rexx on OS/2, and Object Rexx under Windows 95, Windows NT, Linux, and AIX. The Regina Rexx interpreter is supported as an alternate for Windows 95 and Windows NT, and the only interpreter under Sun Solaris. Rexx is unsupported in the DOS version.
When invoking a macro, type either its name or "MACRO name" on the command line. Note that you should not include the file extension unless it is a .CMD file - the X2 Editor automatically suffixes the macro name with .X before searching for it on disk. On the other hand, macros with an extension of .CMD must include the file extension on the command line if they are to use the X addressing environment to communicate with the editor.
When a macro is started, the default Address for command resolution is X. Commands that you issue to the operating system environment through the editor will work, but it is recommended that you use Address CMD when you wish to execute a shell function. You may use the Address() function in a Rexx program to determine the current address environment. Note that if you are using Regina Rexx, Address CMD will not work, and you should use Address SYSTEM instead.
When you issue a command on the command line, it is first checked against the builtin editor commands. If not found, it is assumed to be a macro name, and the command is issued as a macro. If the macro was not found, it is issued to the operating system as a shell command.
You can specify parameters to a macro on the command line. Facilities exist to communicate with the editor by issuing any editor command from the macro.
If a macro supplies a numeric return code on the Exit statement, this return code will be passed to the calling program, which may be another macro.
Note that macro names can only contain alphanumeric characters, i.e. any
of the letters a-z and numbers 0-9. This is because X2 terminates a command
at the first non-alphanumeric character. The first non-alphanumeric
character becomes the start of the command arguments, if any.
If desired, macros can be debugged by inserting Trace statements in the
code and watching the results on the screen. If there are many statements
they may scroll off the screen and be difficult to read. Any trace
statements may be re-directed to a file with the greater-than (>) sign, as
follows:
In the above example, macroname would be executed normally,
with the specified parms. If macroname contains any Rexx Trace
statements, the results of these statements will be written to
macro.out instead of to the screen.
IMPORTANT NOTE: If debugging and using interactive tracing, i.e. the
Trace ? format, it is possible to cause the session to hang if an
invalid Rexx statement is issued. This is a known problem; unfortunately
there is no known solution at present.
The EXTRACT command is particularly useful for gaining access to
editor variables from macros. If an Extract command is successful, it will
set the results in Rexx stem variables. In all cases, stem.0 contains the
number of variables set.
Use the following syntax:
The table below
contains a list of all the available Extract options and
the variables they will set. The possible return codes are:
This table shows all the available Extract options, and the Rexx
variables which will be set in response to the Extract command.
Macro Debugging
macroname parms >macro.out
EXTRACT Command
EXTRACT /opt/
Extract Options
Option | Variable | Contents |
---|---|---|
ALT |
ALT.0 ALT.1 ALT.2 |
The number of variables returned (2) The number of changes made since the last autosave The number of changes made since the last save |
APIFILE |
APIFILE.0 APIFILE.1 |
The number of variables returned (1) The APIFile name for the current file |
AUTOSAVE |
AUTOSAVE.0 AUTOSAVE.1 |
The number of variables returned (1) The autosave value |
BOOKMARK |
BOOKMARK.0 BOOKMARK.n |
The number of variables returned The nth bookmark in line,column format, or 0,1 if undefined |
CD |
CD.0 CD.1 |
The number of variables returned (1) The current directory |
CMDLINE |
CMDLINE.0 CMDLINE.1 |
The number of variables returned (1) 1 if the command line is active, or 0 if the cursor is in the file. |
CODE_TYPE |
CODE_TYPE.0 CODE_TYPE.1 |
The number of variables returned (1) The code type, as inferred from the filetype. Possible values are ASM, BASIC, C, HELP, NETREXX, REXX, SCRIPT, and NONE. |
COLOUR areaname |
COLOUR.0 COLOUR.1 COLOUR.2 COLOUR.3 |
The number of variables returned (3) The colour area name The foreground colour The background colour |
COLOURS |
COLOURS.0 COLOURS.n |
The number of variables returned The nth colour definition, in the format areaname foreground ON background |
COMMENTS |
COMMENTS.0 COMMENTS.1 COMMENTS.2 COMMENTS.3 |
The number of variables returned (3) The comment prefix string defined in the user profile. The comment suffix string. The quick comment string. |
CURLINE |
CURLINE.0 CURLINE.1 CURLINE.2 CURLINE.3 CURLINE.4 CURLINE.5 CURLINE.6 CURLINE.7 |
The number of variables returned (7) The contents of the current file line, with nulls converted into the null_char 1 if the line is visible, or 0 if it is hidden. The number of hidden lines The shadow text for the current line. 1 if the line is an error line, 0 if not. Up to 40 characters of the line in hexadecimal format 1 if a popup window is active, or 0 otherwise |
CURSOR |
CURSOR.0 CURSOR.1 CURSOR.2 CURSOR.3 CURSOR.4 CURSOR.5 |
The number of variables returned (4 or 5) The cursor row in the file. The cursor column in the file. 1 if the line is visible, or 0 if it is hidden. 1 if the column is visible, or 0 if it is hidden. The numeric offset from the beginning of the file if hex display is on. |
ESCAPE |
ESCAPE.0 ESCAPE.1 |
The number of variables returned (1) The escape character. |
EXT |
EXT.0 EXT.1 |
The number of variables returned (1) The current file extension |
FIELDTEMPLATE |
FIELDTEMPLATE.0 FIELDTEMPLATE.1 |
The number of variables returned (1) The field template for the current file |
FILEINFO |
FILEINFO.0 FILEINFO.1 FILEINFO.2 FILEINFO.3 FILEINFO.4 FILEINFO.5 FILEINFO.6 FILEINFO.7 FILEINFO.8 FILEINFO.9 FILEINFO.10 FILEINFO.11 FILEINFO.12 FILEINFO.13 FILEINFO.14 FILEINFO.15 |
The number of variables returned (15) The current file name The number of lines in the file The current file alteration count The current file autosave count The current edit mode, "BROWSE" or "EDIT" The current syntax filetype The current file WRAP setting The current file SHADOW setting The current file bookmark numbers. If there are too many bookmarks to fit into the available space (80 bytes), then the list will be truncated. The current file comment markers The current file cursor position The current file margins The current file tab settings The current file code type "NEW" if the file is new, "OLD" otherwise |
FILENAME |
FILENAME.0 FILENAME.1 |
The number of variables returned (1) The name of the currently edited file. |
FIND |
FIND.0 FIND.1 FIND.2 FIND.3 FIND.4 FIND.5 FIND.6 |
The number of variables returned (5) The text of the find string(s) The find arguments The name of the file containing the last match. Set to "" at editor initialisation time, and if the file is quit. The row number of the last successful match The column number of the last successful match The string that was found |
FLSCREEN |
FLSCREEN.0 FLSCREEN.1 FLSCREEN.2 |
The number of variables returned (2) The line number of the first line displayed on the screen. The line number of the last line displayed on the screen. |
FT |
FT.0 FT.1 |
The number of variables returned (1) The current syntax filetype. This is either the file extension or the result of the FT command. It will always be upper case in order to allow easier comparison operations in macros. |
FUNCTION |
FUNCTION.0 FUNCTION.1 FUNCTION.2 |
The number of variables returned (2) The text of the current function definition line. The line number of the current function. |
HELPFILE |
HELPFILE.0 HELPFILE.1 |
The number of variables returned (1) The help file name |
INSERT |
INSERT.0 INSERT.1 |
The number of variables returned (1) 1 if the cursor is in INSERT mode, or 0 if it is in overstrike (REPLACE) mode. |
KEY keyname |
KEY.0 KEY.1 |
The number of variables returned (1) The current setting for keyname, where keyname is any key that may be modified through the user profile. |
KEYPRESS |
KEYPRESS.0 KEYPRESS.1 |
The number of variables returned (1) The name of the next depressed key. Will wait until the user presses a key before returning. |
LASTMSG |
LASTMSG.0 LASTMSG.1 |
The number of variables returned (1) The last displayed message |
LINE <n> |
LINE.0 LINE.1 LINE.2 LINE.3 LINE.4 LINE.5 LINE.6 LINE.7 |
The number of variables returned (7) The contents of the file line n, where n defaults to the current line 1 if the line is visible, or 0 if it is hidden. The number of hidden lines The shadow text for the line. 1 if the line is an error line, 0 if not. Up to 40 characters of the line in hexadecimal format 1 if a popup window is active, or 0 otherwise |
LINECOLOUR |
LINECOLOUR.0 LINECOLOUR.x |
The number of variables returned, which varies according to the number of line segments in the line The highlighting attributes for a line segment, in the format start_col end_col index, where start_col is the starting column number, end_col is the ending column number, and index is an index to the extract /colours/ array. If the linecolour command has been used on the current line, index is replaced by the fg on bg format. |
LINEFIELDS |
LINEFIELDS.0 LINEFIELDS.1 |
The number of variables returned (1) The line fields for the current line |
LINEND |
LINEND.0 LINEND.1 |
The number of variables returned (1) The current LINEND setting, and the LINEND character |
MARGINS |
MARGINS.0 MARGINS.1 MARGINS.2 MARGINS.3 MARGINS.4 |
The number of variables returned (4) The left file margin The right file margin The left paragraph formatting margin The right paragraph formatting margin |
MARK |
MARK.0 MARK.1 MARK.2 MARK.3 MARK.4 MARK.5 MARK.6 MARK.7 |
The number of variables returned. 0 if there is no mark, or 7 if a mark exists. The marked file name. The first marked line number. The last marked line number. The first marked column number. This will be 0 if the mark is a line mark. The last marked column number. This will be 0 if the mark is a line mark. 1 if the marked file is the current file, or 0 otherwise. 1 if the mark is a word mark, or 0 otherwise. |
MARKTEXT |
MARKTEXT.0 MARKTEXT.x |
The number of variables returned, which equals the number of visible marked lines The contents of the Nth marked line. If the mark is a block mark, only the marked portion of the line is returned. |
MSGMODE |
MSGMODE.0 MSGMODE.1 |
The number of variables returned (1) The current MSGMODE setting. |
NAME |
NAME.0 NAME.1 |
The number of variables returned (1) The name of the currently edited file. |
OS |
OS.0 OS.1 OS.2 OS.3 OS.4 |
The number of variables returned (4) The operating system name - "OS/2", "Windows NT", "Windows 95", "AIX", "Linux", "SunOS", or "HP-UX" The operating system version The directory path separator character The separator character between multiple paths |
PFLINE |
PFLINE.0 PFLINE.1 |
The number of variables returned (1) The current PF display text when no shift keys are active. |
RING |
RING.0 RING.1 RING.n |
The number of variables returned, which is also the number of files in the edit ring. The first file in the ring, which is also the current file. The nth file in the ring |
SCREEN |
SCREEN.0 SCREEN.1 SCREEN.2 |
The number of variables returned (2) The number of rows in the screen The number of columns in the screen |
SHADOW |
SHADOW.0 SHADOW.1 |
The number of variables returned (1) ON if the SHADOW setting is ON, or OFF if it is OFF. |
SHADOWTEXT |
SHADOWTEXT.0 SHADOWTEXT.1 |
The number of variables returned (0 or 1) The shadow text for the current line, if set. |
SIZE |
SIZE.0 SIZE.1 |
The number of variables returned (1) The number of lines in the current file |
STATUSTEXT |
STATUSTEXT.0 STATUSTEXT.1 |
The number of variables returned (1) The statustext template for the current file |
TABS |
TABS.0 TABS.1 |
The number of variables returned (1) The tab settings for the current file |
VERSION |
VERSION.0 VERSION.1 |
The number of variables returned (1) The editor version number |
WRAP |
WRAP.0 WRAP.1 |
The number of variables returned (1) ON if the WRAP setting is ON, or OFF if it is OFF. |
X2PATH |
X2PATH.0 X2PATH.1 |
The number of variables returned (1) The XPATH/X2PATH setting |
To search for text in a file, use the L command. This command has the following syntax:
<L <~>/text</< |/& <~>/text2/> -mecflqs>
where:
The l option is useful when used with the m option for locating blank lines. If a block mark is set in column one of the file, the following command will locate the next blank line in the file:
L // lm
When specifying search text, either normal ASCII characters may be used, or a hexadecimal representation may be used. When specifying search strings in hex, use the following syntax:
'hhhh'x
The following rules apply to hex strings:
The following return codes may be received from the Locate command:
To change the text in a file, use the C command. This command has the following syntax:
C /from/to</ mecflps*N>
where:
If the * (change all) option is not used, the first occurrence of from will be found and a message asking Yes/No/Last/Go/Quit/Abort will be displayed. After the first change an additional option of Undo will be present. Press the first letter of the option you wish, where the options are as follows:
The following return codes may be received from the Change command:
The X2 Editor provides several facilities for the macro writer to communicate with the user; one of the most useful ways is through popup windows. Popup windows are defined as windows which appear in the middle of the editor screen to display information and receive a response. The X2 Editor provides the following types of popup windows:
You can display a list of items for user selection or reference. This type of popup is the most complicated, and typically uses several commands to set up and display the window. These are:
The following example displays a popup window and waits for user response. If a line is selected, the macro is re-invoked with a parameter which determines subsequent action. This old method of using popup windows is a bit cumbersome and difficult to follow, as it requires the macro to be invoked twice and parameters must be passed between the two invocations.
/* */ Parse Source os invoke sourcefn . Parse Var sourcefn sourcefn '.' . Parse Arg opt . Select When opt = 'One' Then 'MESSAGEBOX You selected line 1' When opt = 'Two' Then 'MESSAGEBOX You selected line 2' Otherwise Do 'WINDOW 2 40 2 Test Window' 'WINLINE Line 1\nMACRO' sourcefn 'One' 'WINLINE Line 2\nMACRO' sourcefn 'Two' End End Exit
The next example uses SETRESULT and WINWAIT to improve the logic flow of the macro. WINWAIT causes the window to be displayed while the calling macro is still active; when a user selects an entry the variable result will be set to a parameter which can be used further down in the program.
/* */ 'WINDOW 2 40 2 Test Window' 'WINLINE Line 1\nSETRESULT One' 'WINLINE Line 2\nSETRESULT Two' 'WINWAIT' Select When result = 'One' Then 'MESSAGEBOX You selected line 1' When result = 'Two' Then 'MESSAGEBOX You selected line 2' Otherwise Nop /* User probably escaped*/ End Exit
A message box is used simply to provide information to a user, and optionally to retrieve a single key in response. The example below shows a message box which displays the text "Hello" centred on line one, and "World" left-aligned on the second line. The return code will be non-zero if the user presses escape, and the key they pressed is returned in the special Rexx variable result.
/* */ 'EXTRACT /ESCAPE/' 'MESSAGEBOX Hello' || escape.1 || 'NWorld' 'MSG Messagebox return code was' rc 'and the result was' result
A prompt is a special kind of message box, where space is provided for the user to enter text as a response. The response is returned in the Rexx variable result.
/* */ 'PROMPT Please enter your name' If rc = 0 Then 'MSG Hello' result
In a prompt window, the Tab key acts as it does on the command line: the
previous word on the line is expanded to a filename from disk.
Use the
password
command to retrieve information from the user, but not display it on the
screen. Instead of echoing the user input inside the message box, asterisks
are used as placeholders. Just like the Prompt command, the response is
returned in the Rexx variable result.
This section
contains a description of all commands available from the
command line. Some of these commands are only really useful from macros,
although all can be issued from the editor command line.
Many are not available in the DOS version to save on space. These are
detailed in
Differences in the DOS Version.
Syntax: ACCENT [ACUTE &vbar. CEDILLA &vbar. CIRCONFLEX &vbar. GRAVE
&vbar. TILDE &vbar. TREMA &vbar. UMLAUT]
Description: Input an accented character. This command prompts the user
for a key (one of aeiouAEIOUcCnN and space, depending on the option), and
enters the appropriate accented letter.
This command is only supported under Windows, and is intended to be assigned
to a key, usually an AltGr key on an NLS-enabled keyboard.
Default Key: none
Return Codes:
Syntax: ADD
Description: Add a column of marked numbers
Default Key: a-padplus
Return Codes:
Syntax: ALL </text</ +-mecfls~>
Description: Display only those lines which contain text.
Options:
Default Key: c-u
Return Codes:
Syntax: ALT altcount <chgcount>
Description: Set the alteration count(s) for the file.
altcount specifies the number of changes since the last autosave.
chgcount, if specified, is the number of changes since the last
save. If chgcount is 0, QUIT will exit the file without
confirming potential data loss. Otherwise, the file is assumed to have been
modified and the QUIT function will ask for confirmation.
Default Key: none
Return Codes:
Syntax: APPEND fn
Description: Appends all visible lines in the current file to the supplied
fn. Any lines which have been excluded from the display are not
copied to the new file. If a mark exists in the current file, only visible
lines in the marked area are copied.
Default Key: none
Return Codes:
Syntax: ASCII
Description: Escape to enter characters in ASCII mode.
Default Key: a-x
Return Codes:
Syntax: AUTOBOOKMARK
Description: Move to an automatic bookmark position. Displays a window
showing all the automatic bookmarks for selection - selecting an item will
move the cursor to that position in the current file.
Note that automatic bookmarks must be turned on in the profile, see
Automatic Bookmarks.
Default Key: none
Return Codes:
Syntax: AUTOSAVE <n>
Description: Set the autosave value for the file. Every time the
alteration count reaches this value, the file will be automatically saved to
a temporary file on disk. The temporary filename is the same as the current
filename, except that the extension is replaced with the first value from
(000, 001, 002, ..., 009) that will create a unique filename.
If n is 0, the file will never be auto-saved.
If n is omitted entirely, the file will be autosaved immediately.
Default Key: none
Return Codes:
Syntax: BACKSPACE
Description: Move the cursor one position to the left, and delete the
character in the new position. If the cursor is positioned on the first file
column, the current line will be joined with the previous line and the cursor
moved to the intersection point.
Default Key: backspace
Return Codes:
Syntax: BACKTAB
Description: Move the cursor to the previous tab position
Default Key: backtab
Return Codes:
Syntax: BACKWARD
Description: Scroll the screen a full page towards the top of file.
The cursor position on the screen will be unchanged, unless the first
page is reached.
Default Key: none
Return Codes:
Syntax: BOOKMARK <n1 <n2<,n3>> &vbar. SET &vbar. GO &vbar.
PUSH>
Description: Set or move to a bookmark position. n1 specifies
the bookmark number. If n2 is specified, it indicates the new
line setting for the bookmark; otherwise, the cursor will be moved to the
bookmark number n1. If n3 is also specified, it
indicates the new column setting for the bookmark. If n3 is not
specified, the column defaults to column 1.
If no parameters are supplied, or the SET parameter is used, a
bookmark will be set at the current cursor position. Note that if
quickmarks
are on the first bookmark is set; if multiple bookmarks
are allowed, a window is displayed to prompt for the bookmark number.
The
GO parameter moves the cursor to a previously saved bookmark. If
more than one bookmark is allowed, the user is prompted to select the
correct bookmark number from a list of set bookmarks.
The PUSH option forces quickmarks behaviour; the current cursor
position is added to bookmark number 1, and the remaining bookmarks are
pushed down the stack.
Default Keys: c-b, c-g
Return Codes:
Syntax: BOTTOM
Description: Move to the bottom line of the file
Default Key: c-end
Return Codes:
Syntax: BOTTOMSCREEN
Description: Move to the bottom line of the screen
Default Keys: c-pgdn, a-down
Return Codes:
Syntax: BROWSE <ON &vbar. OFF>
Description: Turn the browse setting on or off. If no parameters are
specified, the browse setting is toggled.
Default Key: none
Return Codes:
Syntax: C /from/to</ mecflps*N>
Description: Change occurrences of from into to.
See
Change Text
for details.
Default Key: none
Return Codes:
See
Change Text
Syntax: CASECHAR <UPPER &vbar. LOWER>
Description: Change the case of the current character to UPPER or lower,
depending on the parameter, and move the cursor one position to the right.
The default parameter is UPPER.
Default Key: c-up, c-down
Return Codes:
Syntax: CASEWORD
Description: Rotate the case of the current word, through UPPER, Mixed,
and lower. If the cursor is on a non-alphanumeric character, the case of the
previous word will be changed, unless the cursor is at or near the beginning
of the line, in which case the next word will be changed.
Default Key: c-f10
Return Codes:
Syntax: CD <d:\path>
Description: Change the current drive and directory for subsequent
commands. If d: is omitted, the drive remains the same. If
path is omitted, the current directory for the new drive will be
used. If both are omitted, the current directory information will be
displayed. The original directory information will be restored upon
editor termination.
Default Key: none
Return Codes:
Syntax: CENTRELINE
Description: Centre the current row on the screen.
Default Key: s-f5
Return Codes:
Syntax: CENTRETEXT
Description: Centre text on the current line between the comment margins,
or between the mark if the line is marked with a block mark.
Default Key: a-t
Return Codes:
Syntax: CHANGES
Description: Display only those lines which have been changed in this
editing session
Default Key: none
Return Codes:
Syntax: CLIP <COPY &vbar. CUT &vbar. PASTE <BLOCK>>
Description: Manipulate the clipboard on 32 bit Windows or Unix systems.
Options:
Default Key: none
Return Codes:
Syntax: CMDLINE <TOP &vbar. BOTTOM>
Description: Set the command line position to either the top or the
bottom of the screen, where TOP is the system default. If no parameter is
provided, the command line setting alternates between TOP and BOTTOM. To
change the default through the user profile, see
Command Line Location.
Default Key: none
Return Codes:
Syntax: CMDTEXT text
Description: Display text on the command line and position the
cursor at the end of text.
Default Key: f6
Return Codes:
Syntax: COMMAND internal command
Description: Execute an internal command, but bypass any possible
synonym or macro resolution.
Default Key: none
Return Codes: From internal command
Syntax: COMMENTLINE <FULL <c> &vbar. EMPTY>
<INDENT>
Description: Input a block comment line. The default FULL
option fills the line with asterisks, while the EMPTY option
contains blanks. The optional parameter c will fill the line with
the character c.
The optional parameter INDENT will cause the comment line to be
inserted with the same indentation as the current line.
Default Keys: a-7, a-8
Return Codes:
Syntax: COMMENT_STYLE <ALIGN_QUICK &vbar. COLSTART &vbar. CONVERT_ALLQUICK &vbar.
CONVERT_QUICK &vbar. CPP_CONDITIONAL &vbar. C_CONDITIONAL &vbar. IF_MODIFIED &vbar.
KEEP_BLANKS &vbar. LEFT &vbar. NO_BLOCKS &vbar. RIGHT &vbar. UPPERCASE>
Description: Modify the automatic comment formatting style. For a
complete description of the various options, refer to
Inline Comment Formatting Control.
Default Key: c-c
Return Codes:
Syntax: COMPARE <DIFF &vbar. SYNC &vbar. MERGE>
Description: Compare two files. The DIFF option stops the cursor at the
first non-matching lines, and is the default.
The SYNC option will try to
re-synchronise the files to common lines. The MERGE parameter copies
differing lines from the current file to the next file in the ring, until a
set of matching lines is found.
Default Keys: a-f2, a-f3, a-f4
Return Codes:
Syntax: CONDITIONAL <IF &vbar. ELSE &vbar. END>
Description: Input conditional compilation IF,
ELSE, or END command. The default values are
#if 0, #else, and #endif respectively.
Conditional strings may be set in the user profile with the
CONDITIONALS keyword.
Default Key: a-0
Return Codes:
Syntax: COPYLINE
Description: Copy the current line. The new line is inserted immediately
following the current line.
Default Key: c-k
Return Codes:
Syntax: COPYTOCMD
Description: Copy the current line's text to the command line.
If a block mark exists on the current line, just that portion of the line
will be copied.
Default Key: c-l
Return Codes:
Syntax: COUNT /text</< |/& /text2/> -mecfls>
Description: Count the number of occurrences of the target
string(s). See
Locate Text
for details on specifying options.
Default Key: none
Return Codes:
Syntax: CURR_ALT_PFLINE text
Description: Use the new text for the PF display line when the
Alt key is active, but only for the current file.
Default Key: none
Return Codes:
Syntax: CURR_CTRL_PFLINE text
Description: Use the new text for the PF display line when the
Ctrl key is active, but only for the current file.
Default Key: none
Return Codes:
Syntax: CURR_PFLINE text
Description: Use the new text for the PF display line when no
shift keys are active, but only for the current file.
Default Key: none
Return Codes:
Syntax: CURR_SHIFT_PFLINE text
Description: Use the new text for the PF display line when the
Shift key is active, but only for the current file.
Default Key: none
Return Codes:
Syntax: CURSOR <+|->row <<+|->col> &vbar. BEGMARK &vbar. CMDLINE &vbar. COL1 <STAY> &vbar.
DATA &vbar. ENDMARK &vbar. EOL <STAY> &vbar. NEXTLINE &vbar. TOGGLE
Description: Move the cursor to the row and column
specified. If a plus or minus sign is specified, the offset will be relative
from the current cursor position. Instead of numeric parameters, one of the
following words may be specified:
Default Keys: end, enter, home, a-e, a-y
Return Codes:
Syntax: DATE EUROPEAN &vbar. LONG &vbar. ORDERED &vbar. SORTED &vbar. USA
Description: Input the current date into the file at the current cursor
location. The option controls the date format:
The Sorted and Long options return a four digit
year. Under Windows and Unix systems, the century is calculated from a two
digit year: if the system year is less than 50 the 21st century is assumed;
otherwise the 20th century is returned. This code is only available in
versions 1.98 Beta D and above.
Default Keys: a-f9, c-f9
Return Codes:
Syntax: DELCHAR
Description: Delete the current character at the cursor position.
Default Key: Del
Return Codes:
Syntax: DELDUPES <C &vbar. E>
Description: Remove all duplicate lines from a file. If there is a
marked area in the current file, the search is restricted to the marked
lines. If the mark is a block mark, the search is further restricted to the
marked columns within the block. If the C parameter is used,
case is ignored when comparing lines. The E (exact case match)
parameter is the default.
Default Key: none
Return Codes:
Syntax: DELETE <N &vbar. *>
Description: Delete the current line from the file.
If N is supplied, the given number of lines will be deleted.
If N is an asterisk (*), all lines from the current line to the
end of file will be deleted.
Default Key: c-backspace
Return Codes:
Syntax: DELSYM
Description: Delete the current symbol from the cursor position to the
beginning of the next punctuation. If the cursor is on a punctuation mark,
this function will delete all punctuation up to the next symbol.
Default Keys: none
Return Codes:
Syntax: DELWORD
Description: Delete the current word from the cursor position to the
beginning of the next word
Default Keys: c-d, c-del
Return Codes:
Syntax: DIAG
Description: Output diagnostics into a file called .XDIAG. The output
file consists of the following main sections:
Default Key: none
Return Codes:
Syntax: DOWN <N &vbar. *>
Description: Move the cursor down one row.
If N is supplied, the cursor will be moved the given number of
lines.
If N is an asterisk (*), the cursor will be moved to the
last line of the file.
Default Key: down
Return Codes:
Syntax: DUPLICATES <DELETE &vbar. ALL &vbar. EXCLUDE> <C &vbar. E>
Description: Work with duplicate lines in the current file:
If there is a marked area in the current file, the search is restricted to
the marked lines. If the mark is a block mark, the search is further
restricted to the marked columns within the block. If the C
parameter is used, case is ignored when comparing lines. The E
(exact case match) parameter is the default.
Default Key: none
Return Codes:
Syntax: EDIT <fn1 fn2...> <options>
Description: Add the specified file(s) to the edit ring. See
Invoking The Editor
for details on options and file name syntax.
Default Key: none
Return Codes:
Syntax: EA <ON &vbar. OFF>
Description: Turn the saving of editor information with extended
attributes on or off. If no parameters are specified, the EA setting is
toggled.
Default Key: none
Return Codes:
Syntax: EOF_TEXT text
Description: Change the text used to mark the end of the current file
Default Key: none
Return Codes:
Syntax: ERASEEOL
Description: Erase the current line from the cursor position.
Default Key: c-e
Return Codes:
Syntax: ERRORS <SHOW &vbar. NEXT &vbar. REMOVE>
Description: Handle compiler errors, where SHOW (the default)
copies error lines from fn.err into the current file,
NEXT moves the cursor to the next error line, and
REMOVE removes all error lines from the current file. See
Compiler Errors
for more information on creating and using compiler error files.
Default Keys: a-q, c-n, c-o
Return Codes:
Syntax: EXCLUDE <N &vbar. * &vbar. TOGGLE &vbar. AREA>
Description: Exclude the line(s) at the cursor position, with the
following options:
Default Keys: c-a, c-x
Return Codes:
Syntax: EXITRC nnn
Description: Set the editor exit return code to nnn. This
option is useful when
calling the editor from other environments, where a return code would be a
handy way to communicate some information from the editor back to the calling
environment. The normal editor return code is 0.
Default Key: none
Return Codes:
Syntax: EXPAND
Description: This command is used to expand a few letters of a
word into a longer word. If invoked from the data area, it examines
previously entered text to find a word that begins with the text that is
found at the cursor position. If found, the word at the cursor
position is replaced with the full word. Repeated presses of this key
will provide alternative expansions for the current word. Insert mode is
always turned on for this operation, so no existing data will be overwritten.
If this command is invoked from the command line, it will take the
characters on the command line and use them to fill the command line
with the first matching command.
Default Key: a-=
Return Codes:
Syntax: EXT <newext>
Description: If used with no parameter, the current file extension is
displayed. If newext is supplied, the file extension will be
changed to newext.
Default Key: none
Return Codes:
Syntax: EXTRACT /opt/
Description: Gain access to editor information from a Rexx program.
See
EXTRACT Command
for details regarding the various options.
Default Key: none
Return Codes: See
EXTRACT Command
Syntax: FFILE <newname &vbar. /CR &vbar. /CRLF &vbar. /CRCRLF &vbar.
/LF &vbar. /NOEA &vbar. /NOTABS &vbar. /T &vbar. /U>
Description: Save the currently edited file to disk. Exactly like the
FILE command, only it skips the check for a changed filename before saving.
All options are described under
the
SAVE
command.
Default Key: none
Return Codes:
Syntax: FIELDTEMPLATE <c1 [U &vbar. P]>
<c2 [U &vbar. P]> ...
Description: Control default editing of all file lines,
through definition of protected and unprotected fields. See
the
LineFields command
for syntax details.
Default Key: none
Return Codes:
Syntax: FILE <newname &vbar. /CR &vbar. /CRLF &vbar. /CRCRLF &vbar.
/LF &vbar. /NOEA &vbar. /NOTABS &vbar. /T &vbar. /U>
Description: Save the currently edited file to disk. If
newname is supplied, the file will be saved under that name.
Otherwise, the current name will be used. If the save was successful, quit
the file.
All options are described under
the
SAVE
command.
Default Key: none
Return Codes:
Syntax: FIND_WORD
Description: Search forwards in the current file for the word located at
the cursor position. A word is defined as containing only alphanumeric
characters plus the underscore (_) character. Any character which is not in
the range A-Z and is non-numeric will be taken as the end of the word for the
search. The exception to this rule is the case of dates and times. Any
string of the format dd/dd/dd, where dd is a numeric digit and
/ is the system date separator, will be taken as a "word". Similarly,
any string in the format hh:mm:ss or hh:mm:ss.ttt
will be taken as a "word".
If the cursor is on the command line, the command line is replaced with a
locate command showing the current search string. This is useful if you want
to make a small change to the string without having to re-type most of it. A
string delimiter is chosen from the set "/&$:\" that
is not part of the search string.
Default Key: c-w
Return Codes:
Syntax: FORWARD
Description: Scroll the screen a full page towards the end of file.
The cursor position on the screen will be unchanged, unless the last page is
reached.
Default Key: none
Return Codes:
Syntax: FT ext
Description: Treat the file for formatting purposes as if it had the
supplied extension. All syntax expansion and formatting keywords will be
used for the pseudo extension.
Default Key: none
Return Codes:
Syntax: FUNCWIN
Description: Display a popup window containing all functions in the
current file.
Default Key: c-f11
Return Codes:
Syntax: GET filename
Description: Copy the supplied filename into the current
file, starting at the current
cursor position. The file, which cannot contain wildcards, will not be
added to the edit ring.
Default Key: none
Return Codes:
Syntax: HELP
Description: Browse the help file
Default Key: f1
Return Codes:
Syntax: HEX <ON &vbar. OFF>
Description: Turn Hex Display mode
on or off. If no parameters are specified, the current hex display
setting is toggled.
Default Key: a-h
Return Codes:
Syntax: HIDEFILE <ON &vbar. OFF>
Description: Toggle the Hide setting for the current file, or with no
parameters, the current Hide setting is toggled.
If Hidefile is ON, the file will become invisible in the ring, unless it is
explicitly called by name. Note that the file is automatically discarded
when no visible files are left in the ring, even if it has been
modified.
Default Key: none
Return Codes:
Syntax: INPUT <text>
Description: Input a new line into the file, after the current cursor
position. If text is supplied, use that text for the new line.
Default Key: c-enter
Return Codes:
Syntax: INPUT_ERRORLINE text
Description: Input a new line containing text into the file,
after the current cursor position. The new line will have error highlighting
and will be read-only.
Default Key: none
Return Codes:
Syntax: INSMODE <ON &vbar. OFF>
Description: Turn Insert mode
on or off. If no parameters are specified, the current insert mode
setting is toggled. Insert mode is indicated with either Ins or Rep in the
far right of the status line.
Default Key: ins
Return Codes:
Syntax: JOIN
Description: Join the current line with the following line. If the
cursor is after the end of the current line the join occurs at the cursor
position. Otherwise, the lines are joined with a single space between them.
Default Key: a-j
Return Codes:
Syntax: KEY key = func
Description: Set the specified key to the given
func, where func can be any command that may be issued
from the command line. The new key is in effect only for the current file;
to globally set a key use the user profile.
Default Key: none
Return Codes:
Syntax: KEYIN text
Description: Enter the supplied text at the current cursor
position. This function will not work correctly if entered on the command
line; it must be used from a key or a macro only. Note that this command
accepts and keeps trailing spaces.
Default Keys: padplus, a-1, a-2, a-3, a-4, a-5, a-6, a-9, a--, a-\
Return Codes:
Syntax: KEYIN_NAME
Description: Enter the current filename at the current cursor
position.
Default Key: a-n
Return Codes:
Syntax: KEYS_PLAY <N &vbar. *>
Description: Play back a recorded key sequence. This allows a macro to
execute the function normally assigned to the Ctrl-T key. If N is
supplied, the key sequence will be executed the given number of times, unless
it is interrupted by an abnormal key response. If N is an
asterisk (*), the key sequence will be executed until the cursor reaches
either the Top Of File line or the End Of File line, or until an abnormal key
response.
Recorded Key Sequences
contains more information about recording and playing back key sequences.
Default Key: c-t
Return Codes:
Syntax: KEYS_RECORD
Description: Initiate a sequence of recorded keys, which can be played
back later with the Keys_play command.
Recorded Key Sequences
contains more information about recording and playing back key sequences.
Default Key: c-r
Return Codes:
Syntax: KEYS_WRITE fn.x
Description: Translate the current recorded key sequence into the
equivalent Rexx macro. File fn.x will be added to the edit
ring, and will contain skeleton Rexx code. This command is useful for
saving recordings for later playback, or for quickly generating the
basis for a more complicated macro.
Default Key: none
Return Codes:
Syntax: L /text</< |/& /text2/> -mecflqs>
Description: Locate the supplied text.
See
Locate Text
for details.
Default Key: none
Return Codes:
See
Locate Text
Syntax: LINECOLOUR <c1 c2 [fg1 ON bg1
&vbar. /name] c3 c4 fg2 ON bg2 ...>
Description: Control the colouring of the current line.
Columns c1 through c2 are coloured with foreground
colour fg1 on a background of bg1, where foreground and
background colours are described in
Colour Remapping.
Alternatively, / syntax may be used to define line colours.
If a slash is followed by the name of an X2 colour area, e.g.
DATA, then the currently defined settings for that area will be
used to display the given columns.
Multiple sets of columns and colours may be specified in a single command.
No parameters removes any previously specified line colouring for the current
line. Note that explicitly setting a line's colour overrides any syntax
specific colouring that may be applied to a line.
Default Key: none
Return Codes:
Syntax: LINEFIELDS <c1 [U &vbar. P]>
<c2 [U &vbar. P]> ...
Description: Control editing of the current line, through definition of
protected and unprotected fields. Everything from column c1 until the end of
line or the next linefield will be either Unprotected or
Protected, depending on the parameter. The LINEFIELDS
command with no parameters will clear the setting for the current line.
A quick way to set default linefields for every file line is provided with
the
FieldTemplate command.
Note that the LINEFIELDS and FIELDTEMPLATE commands are currently
experimental, and may change or be removed in a future release.
Default Key: none
Return Codes:
Syntax: LINEMACRO <MACRO whatever>
Description: Set a macro which will be executed whenever the user tries
to enter a character on the current line. When a key is pressed, macro
whatever will be called with the following parameters:
where
By default, if a linemacro is called for a line change, the line change
will be suppressed. To let the change proceed, use the EXITRC command to set
the return code to a non-zero value.
To clear a linemacro from the current line, issue the LINEMACRO command
with no parameters.
Default Key: none
Return Codes:
Syntax: LINEND <ON &vbar. OFF <c>>
Description: Turn the linend setting on or off. If no parameters are
specified, the linend setting is toggled. The default setting is ON. If
c is specified, it becomes the new linend character.
Default Key: none
Return Codes:
Syntax: Margins <n1 <n2 <n3 <n4>>>>
Description: Set/query file margins. If no parameters are supplied, the
current margins are displayed. n1 through n4 represent
the left and right file margins, and the left and right comment alignment
margins, respectively. n3 and n4 are also used as the
margins for the
reformat
command. The minimum allowable value for
n4 is 20.
Default Key: none
Return Codes:
Syntax: MACRO macroname <parms>
Description: Execute the specified macroname. The macro must
have a file extension of
X, although the extension is not specified on invocation. Any parameters
which the macro may expect are passed directly to the macro.
Default Key: none
Return Codes:
Syntax: MARK <option>
Description: Create or manipulate a text mark on the text at the current
position.
The following options are available:
Default Keys: a-a, a-b, a-c, a-d, a-f, a-i, a-l, a-m, a-o, a-r, a-u,
a-v, a-w, a-z, c-F3, c-F4, c-F5, c-F7, c-F8
Return Codes:
Syntax: MATCH
Description: Move the cursor to the equivalent string from the set of
conditional strings, brackets, and GML tags. See
Conditional Strings.
Default Key: c-y
Return Codes:
Syntax: MESSAGEBOX text
Description: Display a window containing text. The window is
dismissed after any keypress, and the key pressed is set in the
Rexx variable result.
The supplied text may include multiple output lines, by
separating each line by a sequence consisting of the escape
character immediately followed by the letter N. The first line is
centred on the window; all subsequent lines are left justified.
Default Key: none
Return Codes:
Syntax: MSG <text>
Description: Display text as an editor message.
If text is omitted, any current message text will be cleared.
Default Key: none
Return Codes:
Syntax: MSGMODE <ON &vbar. OFF>
Description: Turn message display on or off. If no parameters are
specified, the msgmode setting is toggled. The default setting is ON.
No information message is displayed when this command is executed. If
message mode is OFF, then all messages are suppressed, except for messages
that require a user response.
Default Key: none
Return Codes:
Syntax: NAME <newname>
Description: Change the name of the current file. If newname
is identified as a host file name, the only
modification to the supplied text is to convert it to upper case. If
newname
is assumed to represent a PC file name, it will be
formatted to a standard d:\path\fn.ext format. If
newname is not specified, the current file's name will be
added to the command line.
The following criteria must all be met to identify a file as a host
filename:
Possible host filenames are ha:PROFILE EXEC A and
hb:myfiles.script(member).
Default Key: f5
Return Codes:
Syntax: NEXT, NEXT_FILE
Description: Make the next file in the edit ring the current file.
Default Key: f12
Return Codes:
Syntax: NEXT_ERROR
Description: Move the cursor to the next compiler error line in the
file.
Default Key: c-n
Return Codes:
Syntax: NEXT_FUNC
Description: Moves the cursor to the next function in the file.
Default Key: a-pgdn
Return Codes:
Syntax: NEXT_PARA
Description: Moves the cursor to the next paragraph in the file.
Default Key: a-end
Return Codes:
Syntax: NEXT_SENTENCE
Description: Moves the cursor to the beginning of the next sentence in
the file.
Default Key: none
Return Codes:
Syntax: NEXT_SYM
Description: Moves the cursor to the next symbol in the
file, where a symbol consists only of the alphanumeric characters, plus the
underscore character. If the cursor is past the end of the current line, the
cursor will be positioned under symbols in the preceeding line until the end
of that line is reached, at which point it will move to the first symbol in
the next line.
Default Key: a-right
Return Codes:
Syntax: NEXT_WORD
Description: Moves the cursor to the next blank-delimited word in the
file. If the cursor is past the end of the current line, the cursor will be
positioned under words in the preceeding line until the end of that line is
reached, at which point it will move to the first word in the next line.
Default Key: c-right
Return Codes:
Syntax: NOP
Description: Null operation. Handy for disabling a key.
Default Keys: s-F6, s-F7, s-F8, s-F9, s-F10, s-F11, s-F12, s-del, s-ins,
c-h, c-i, c-m, c-q, c-z, c-[, c-], c-F1, c-ins, c-tab, a-g, a-k,
a-[, a-], a-F1, a-F5, a-F6, a-F7, a-F8, a-F10, a-F11, a-F12
Return Codes:
Syntax: NUMFILES
Description: Displays the number of files in the edit ring on the
message line.
Default Key: none
Return Codes:
Syntax: OPENFILE
Description: Open (edit) the file named on the current line.
Default Key: c-p
Return Codes:
Syntax: PAGEDOWN
Description: Scroll the screen towards the end of file. The line
containing the cursor will move to the top of the screen, unless the cursor
is already at the top of the screen, in which case a full page is scrolled.
Default Key: pgdn
Return Codes:
Syntax: PAGEUP
Description: Scroll the screen towards the top of file. The line
containing the cursor will move to the bottom of the screen, unless the
cursor is already at the bottom of the screen, in which case a full page
is scrolled.
Default Key: pgup
Return Codes:
Syntax: PASSWORD text
Description: Display a window with text as the title, and
collect user input, but display asterisks (*) in place of each input
character. When the user presses the Enter key, the response text
will be copied into the Rexx variable result. If the user presses
the Escape key, result will not be set and the return
code will be 17. The window will automatically resize itself if the input
spans more than one window line.
Default Key: none
Return Codes:
Syntax: PFLINE text
Description: Use the new text for the PF display line when no
shift keys are active.
Default Key: none
Return Codes:
Syntax: PRESSKEY keyname
Description: Press the key named by keyname. Designed to be
used in conjunction with the
EXTRACT /KEYPRESS/ command.
Default Key: none
Return Codes:
Syntax: PREVIOUS_FILE
Description: Makes the previous file in the ring the current file.
Default Key: f11
Return Codes:
Syntax: PREVIOUS_FUNC
Description: Moves the cursor to the previous function in the file.
Default Key: a-pgup
Return Codes:
Syntax: PREVIOUS_PARA
Description: Moves the cursor to the previous paragraph in the file.
Default Key: a-home
Return Codes:
Syntax: PREVIOUS_SYM
Description: Moves the cursor to the previous symbol in the
file, where a symbol consists only of the alphanumeric characters, plus the
underscore character.
Default Key: a-left
Return Codes:
Syntax: PREVIOUS_WORD
Description: Moves the cursor to the previous blank-delimited word in the
file.
Default Key: c-left
Return Codes:
Syntax: PROMPT text
Description: Display a window with text as the title, and
collect user input. When the user presses the Enter key, the
response text will be copied into the Rexx variable result. If
the user presses the Escape key, result will not be set
and the return code will be 17. The window will automatically resize itself
if the input spans more than one input line.
Default Key: none
Return Codes:
Syntax: PUT fn
Description: Puts all visible lines in the current file to the supplied
fn. Any lines which have been excluded from the display are not
copied to the new file. If a mark exists in the current file, only visible
lines in the marked area are copied.
Default Key: none
Return Codes:
Syntax: QQUIT
Description: Quit the current file without saving any changes.
If the file contains changes, you will not be warned that the
changes will be lost.
Default Key: none
Return Codes:
Syntax: QUIT
Description: Quit the current file. If changes have not been saved, the
following confirmation message will be displayed:
By default, the following responses are possible:
Note that use of the FILE, SAVE, and QUIT keys in response to the
confirmation message is only supported if Rexx and the utilities DLL are
available. These keys may be turned off in the user profile; see
Quit Response When File Modified.
Default Key: f3
Return Codes:
Syntax: REDO
Description: Redo a line change that was previously undone with the Undo
command.
Default Key: f10
Return Codes:
Syntax: REFORMAT
Description: Reformat the paragraph beginning at the cursor position.
If comment markers are active for this file, the paragraph will be formatted
with leading and trailing comment markers. If the first line of text begins
with a dash (-), the following lines will be indented to align after the
dash, and formatting will end at the next line which begins with a dash.
Otherwise, formatting will end at:
The beginning line is examined for leading indentation - all following
text will be indented the same as the current line, unless it begins with a
dash.
Default Key: a-p
Return Codes:
Syntax: REFRESH
Description: Refreshes the screen. Necessary in some macros which
don't happen to call commands which will refresh the screen.
This command also resets the video mode to avoid screen blinking.
Default Key: none
Return Codes:
Syntax: RENAME
Description: Display text on the command line to rename the current file.
Default Key: f5
Return Codes:
Syntax: REPEAT_FIND
Description: Repeat the last locate (L) command.
Default Key: c-f
Return Codes:
Syntax: REPLACE text
Description: Replace the contents of the current line with the supplied
text.
Default Key: none
Return Codes:
Syntax: RESOLVE_FN fn
Description: Resolve a supplied filespec into a format recognisable by
the operating system, as explained in
File Specification.
The resulting filename is displayed on the command line as a message, which
may be accessed by a macro through the EXTRACT /LASTMSG/ command.
Default Key: none
Return Codes:
Syntax: RESTORE_FIND
Description: Restore the previous find text and options. The old
parameters are automatically saved whenever a find command is issued.
Default Key: none
Return Codes:
Syntax: REVERSE_FIND
Description: Repeat the previous find (Locate) command, but search
in the opposite direction. If the previous search was forwards through
the file, this command causes a backwards scan for the same text.
Default Key: c-v
Return Codes:
Syntax: RINGWIN
Description: Display a popup window containing all the files in the ring.
Modified files will be displayed with the window_emphasis colour.
Default Key: c-f12
Return Codes:
Syntax: SAVE <newname &vbar. /CR &vbar. /CRLF &vbar. /CRCRLF &vbar.
/LF &vbar. /NOEA &vbar. /NOTABS &vbar. /T &vbar. /U>
Description: Save the currently edited file to disk. If
newname is supplied, the file will be saved under that name.
Otherwise, the current name will be used. The following flags are available:
Default Key: f4
Return Codes:
Syntax: SCROLL <UP &vbar. DOWN &vbar. LEFT &vbar. RIGHT>
Description: Scroll the screen one unit in the specified direction. The
default option is UP.
Default Key: none
Return Codes:
Syntax: SETRESULT text
Description: Set the value of the Rexx variable RESULT to the supplied
text.
Default Key: none
Return Codes:
Syntax: SHADOW <ON &vbar. OFF>
Description: Turn the shadow line on or off. If no parameters are
specified, the shadow setting is toggled.
Default Key: c-s
Return Codes:
Syntax: SHADOWTEXT <text>
Description: Change the default text that is displayed when the current
line is hidden. If SHADOW is ON and the current line is the first
of a group of excluded lines, the supplied text will be displayed instead of
the normal "N line(s) not displayed" text. To remove the shadow text from a
line, simply omit any parameters.
Default Key: none
Return Codes:
Syntax: SHELL <command>
Description: Shell to the operating system. If a command is
supplied, it will be executed and the editor automatically resumed. If the
Shell command is issued directly from the editor command line, a prompt
message "Press any key to return to X2" will be displayed; or if the command
is issued from a macro no such message will be written. If no command is
supplied, an operating system prompt will be displayed. Typing
exit will return to the editor session.
On Windows or DOS systems, the shell command will try to execute the
program named by the environment variable COMSPEC, or simply
COMMAND.EXE if COMSPEC isn't set.
Under OS/2, the shell command will try to execute the program named by the
environment variable OS2_SHELL, or CMD.EXE if
OS2_SHELL isn't set.
Default Key: none
Return Codes:
Syntax: SHOW <N &vbar. *>
Description: Display the line at the cursor position.
If N is
supplied, then the next N lines will be unexcluded.
If N is an
asterisk (*), all lines from the current line to the End Of File will be
displayed. If N is negative, lines will be excluded from the end
of the excluded block. Note that if SHADOW is OFF,
this command will have no effect.
Default Key: none
Return Codes:
Syntax: SHOWLINE <N>
Description: Display the specified line.
If N is supplied, then line number N will be unexcluded, i.e. made
visible. If N is absent, the current line will be unexcluded.
Default Key: none
Return Codes:
Syntax: SORT <A &vbar. D> <E
&vbar. C> <N>
Description: Sort the lines in the file. If a mark is present, only the
marked lines are sorted. If it is a block mark, the sort columns are bounded
by the mark. The optional flags are:
Default Key: none
Return Codes:
Syntax: SPAN <ON &vbar. OFF>
Description: Turn the span setting on or off. If no parameters are
specified, the span setting is toggled.
Default Key: none
Return Codes:
Syntax: SPLIT
Description: Split the current line at the cursor position.
Default Key: a-s
Return Codes:
Syntax: SPLITJOIN
Description: Split the line at the cursor position, or join with the next
line if positioned after the end of the line
Default Key: f2
Return Codes:
Syntax: STATUS <ON &vbar. OFF>
Description: Turn the status line on or off. If no parameters are
specified, the status setting is toggled.
Default Key: none
Return Codes:
Syntax: STATUSTEXT template
Description: Use the supplied template to draw the normal
(full length, text mode) status line. The template may include any of the
following special identifiers:
The default template is (note the trailing blank):
Default Key: none
Return Codes:
Syntax: STYLE
Description: Format the coding style for the current function. If text
is marked, the style formatting is restricted to the marked text. Requires
styleword settings from the profile.
Default Key: none
Return Codes:
Syntax: SYNTAX <ON &vbar. OFF>
Description: Turn syntax assistance on or off. If no parameters are
specified, the setting is toggled.
Default Key: none
Return Codes:
Syntax: TAB <MATCH>
Description: Moves the cursor to the next tab position. If
Insert mode and tab_insert are both ON then spaces will
be inserted up to the next tab position. If the MATCH parameter
is supplied, the cursor will be moved to align with the next blank-delimited
word on the previous line. The same rules for inserting spaces apply with
the MATCH parameter.
Default Key: tab
Return Codes:
Syntax: TABLINE
Description: Inputs a special line containing a scale of the file
columns, plus a letter "T" for every hard tab stop and a "t" for each soft
tab stop. You may overwrite this line with the space, T, and t characters.
If you do, when you move the cursor from the tab line the new tab settings
will be read from the line and it will be re-written. The tab increment
value is taken to be the first small "t" found after the last hard tab stop.
Default Key: none
Return Codes:
Syntax: TABS <n1 n2 n3...> <,m>
Description: Set/query tab settings, where n1, n2, n3 are hard tab
settings and m is an increment to generate soft tab settings. If no
parameters are supplied, the current tab columns are displayed. If
n1 is the only number specified, tabs will be set every
n1 spaces, beginning in column
1. If the ,m parameter is specified, the tab settings will
continue from the last stop specified, every m spaces. Note that
tab stops must be numeric and they must be specified in ascending sequence.
There is a limit of 31 tab settings for each file.
Default Key: none
Return Codes:
Syntax: TIMER <<<hh:>mm:>ss cmd>
Description: Set a command to be executed every N seconds,
where N is calculated from the hours, minutes, and seconds
specified as the first parameter. The values for hh,
mm, and ss must be numeric, but are not limited to 60,
so for example, 100 may be specified to execute a command every 100 seconds.
If no options are specified, any previous timer setting is cleared.
Default Key: none
Return Codes:
Syntax: TITLE text
Description: Set the window title for an X-Windows editor window to
text. This command is only available in the X-Windows Unix
versions of the editor.
Default Key: none
Return Codes:
Syntax: TOFEOF <ON &vbar. OFF>
Description: Turn display of Top Of File and End Of File lines
on or off. If no parameters are specified, the setting is toggled.
Default Key: none
Return Codes:
Syntax: TOF_TEXT text
Description: Change the text used to mark the beginning of the
current file
Default Key: none
Return Codes:
Syntax: TOP
Description: Move to the top line of the file
Default Key: c-home
Return Codes:
Syntax: TOPLINE N
Description: Position line N at the top of the screen
Default Key: none
Return Codes:
Syntax: TOPSCREEN
Description: Move to the top line of the screen
Default Keys: c-pgup, a-up
Return Codes:
Syntax: UNDO <N &vbar. *>
Description: Undo the previously changed line(s) in the current file.
If N is supplied, it specifies the number of lines or blocks that
will be restored. If N is an asterisk (*), all changes back to
the last save will be removed.
Default Key: f9
Return Codes:
Syntax: UNDO_BLOCK
Description: Treat all line changes up until the next undo_block
as a single change for undo purposes. This command is only valid when issued
from a macro.
Default Key: none
Return Codes:
Syntax: UNDO_LIMIT N
Description: Set the undo limit for the current file to the value of
N, where N may be any positive or negative whole number.
Default Key: none
Return Codes:
Syntax: UP <N &vbar. *>
Description: Move the cursor up one row.
If N is supplied, the cursor will be moved the given number of
lines.
If N is an asterisk (*), the cursor will be moved to the
Top Of File line.
Default Key: up
Return Codes:
Syntax: WINDOW [_RESET &vbar. rows cols maxlines title]
Description: Create a popup window with rows number of rows,
cols number
of columns, and set aside space for maxlines total lines. The
window title will be title, which is limited in length to the
width of the window minus the space required to show the line number.
Note that the window will be empty until lines are added to it
with the WINLINE command.
If the _RESET option is used, a previous window definition will
be
cleared.
User Defined Popup Window
contains more information about popup windows.
Default Key: none
Return Codes:
Syntax: WINLINE linetext\nselcmd
Description: Add a line to a user defined popup window.
linetext defines the text to appear on the window, and
selcmd is the command that will be executed if the line is
selected. During processing, all occurrences of double backslashes ("\\")
are converted to single backslashes and the following character is ignored.
This allows input of text containing "\n" in either linetext
or selcmd.
linetext may contain control sequences to modify the colour
used in the line. Each sequence must begin with the escape
character, and is followed by one of:
This command can return -6 (invalid parameter) under any of the
following conditions:
User Defined Popup Window
contains more information about popup
windows.
ESCAPE Character
discusses setting the escape character in the user profile.
See
Appendix B. Sample
Macro to Create a Popup Window
for an example macro that uses WINLINE commands to create a popup window.
Default Key: none
Return Codes:
Syntax: WINSELECT <N>
Description: Select line N in a user defined popup window,
where N must be numeric. If N is greater than the
total number of rows in the window, the last window line is selected.
If N is omitted, the last entered WINLINE will be selected.
Default Key: none
Return Codes:
Syntax: WINSORT <A &vbar. D>
Description: Sort the lines in a user defined popup window. The optional
parameters are used to define an Ascending or Descending sort, where the
default is Ascending. Lines will be sorted by Selection escape
sequence if defined, or by the first character of the line if not.
If a previous
WINSELECT
command has been issued, the selected line will move with the sort to
maintain the same line contents.
Default Key: none
Return Codes:
Syntax: WINWAIT
Description: Wait for an existing popup window to be dismissed. Useful
to allow a macro to display a window and wait for a response without losing
control. Best used in conjunction with the
SETRESULT
command to get a response.
Default Key: none
Return Codes:
Syntax: WRAP <ON &vbar. OFF>
Description: Turn the wrap setting on or off. If no parameters are
specified, the wrap setting is toggled.
Default Key: none
Return Codes:
Syntax: nnn
Description: Move the cursor to line nnn of the file. If
nnn is larger than the file
size, the cursor is moved to the last line of the file.
Default Key: none
Return Codes:
Syntax: /text</< |/& /text2/>> -mecflqs
Description: A short form for the L command to locate text.
See
Locate Text
for details.
Default Key: none
Return Codes:
See
Locate Text
The following tables
contain an entry for each command that is recognised by the X2 Editor
command
line. Commands that are supported by the OS/2 version are marked with a
check mark (´) in the first column, commands that are supported
under Windows NT/95 are marked in the second column, and supported DOS
commands are marked in the third column. Supported Unix commands
are marked in the last column, where Unix commands apply to the Linux, AIX
4.1, AIX 4.2, SunOS, and HP-UX operating systems if Rexx is installed.
Password Prompt
/* */
'PASSWORD Please enter your password'
If rc = 0
Then 'MSG You can trust me with' result
Editor Commands
ACCENT
ADD
ALL
ALT
APPEND
ASCII
AUTOBOOKMARK
AUTOSAVE
BACKSPACE
BACKTAB
BACKWARD
BOOKMARK
BOTTOM
BOTTOMSCREEN
BROWSE
C, CHANGE
CASECHAR
CASEWORD
CD
CENTRELINE
CENTRETEXT
CHANGES
CLIP
CMDLINE
CMDTEXT
COMMAND
COMMENTLINE
COMMENT_STYLE
COMPARE
CONDITIONAL
COPYLINE
COPYTOCMD
COUNT
CURR_ALT_PFLINE
CURR_CTRL_PFLINE
CURR_PFLINE
CURR_SHIFT_PFLINE
CURSOR
DATE
DELCHAR
DELDUPES
DELETE
DELSYM
DELWORD
DIAG
DOWN
DUPLICATES
E, EDIT, X
EA
EOF_TEXT
ERASEEOL
ERRORS
EXCLUDE
EXITRC
EXPAND
EXT
EXTRACT
FFILE
FIELDTEMPLATE
FILE
FIND_WORD
FORWARD
FT
FUNCWIN
GET
HELP
HEX
HIDEFILE
INPUT
INPUT_ERRORLINE
INSMODE
JOIN
KEY
KEYIN
KEYIN_NAME
KEYS_PLAY, PLAYBACK
KEYS_RECORD
KEYS_WRITE
L, LOCATE
LINECOLOUR
LINEFIELDS
LINEMACRO
CHAR c rr nn mode b
LINEND
MA, MARGINS
MACRO
MARK
MATCH
MESSAGEBOX
MSG
MSGMODE
NAME
NEXT, NEXT_FILE
NEXT_ERROR
NEXT_FUNC
NEXT_PARA
NEXT_SENTENCE
NEXT_SYM
NEXT_WORD
NOP
NUMFILES
OPENFILE
PAGEDOWN
PAGEUP
PASSWORD
PFLINE
PRESSKEY
PREVIOUS_FILE
PREVIOUS_FUNC
PREVIOUS_PARA
PREVIOUS_SYM
PREVIOUS_WORD
PROMPT
PUT
QQ, QQUIT
QUIT
Throw away changes?
Yes No Write
REDO
REFORMAT
REFRESH
RENAME
REPEAT_FIND, REPFIND
REPLACE
RESOLVE_FN
RESTORE_FIND
REVERSE_FIND
RINGWIN
SAVE
SCROLL
SETRESULT
SHADOW
SHADOWTEXT
SHELL
SHOW
SHOWLINE
SORT
SPAN
SPLIT
SPLITJOIN
STATUS
STATUSTEXT
"'\x'x Col=\c Row=\r of \t Alt=\a "
STYLE
SYNTAX
TAB
TABLINE
TABS
TIMER
TITLE
TOFEOF
TOF_TEXT
TOP
TOPLINE
TOPSCREEN
UNDO
UNDO_BLOCK
UNDO_LIMIT
UP
WINDOW
WINLINE
WINSELECT
WINSORT
WINWAIT
WRAP
nnn
/text</< |/& /text2/>>
Command Summary
Command Summary (A-H)
Command | OS/2 |
Windows NT/95 |
DOS | Unix |
---|---|---|---|---|
ACCENT | ´ | |||
ADD | ´ | ´ | ´ | ´ |
ALL | ´ | ´ | ´ | ´ |
ALT | ´ | ´ | ´ | ´ |
APPEND | ´ | ´ | ´ | ´ |
ASCII | ´ | ´ | ´ | ´ |
AUTOBOOKMARK | ´ | ´ | ´ | ´ |
AUTOSAVE | ´ | ´ | ´ | ´ |
BACKSPACE | ´ | ´ | ´ | ´ |
BACKTAB | ´ | ´ | ´ | ´ |
BACKWARD | ´ | ´ | ´ | ´ |
BOOKMARK | ´ | ´ | ´ | |
BOTTOM | ´ | ´ | ´ | ´ |
BOTTOMSCREEN | ´ | ´ | ´ | ´ |
BROWSE | ´ | ´ | ´ | ´ |
C | ´ | ´ | ´ | ´ |
CASECHAR | ´ | ´ | ´ | |
CASEWORD | ´ | ´ | ´ | ´ |
CD | ´ | ´ | ´ | |
CENTRELINE | ´ | ´ | ´ | ´ |
CENTRETEXT | ´ | ´ | ´ | ´ |
CHANGE | ´ | ´ | ´ | ´ |
CHANGES | ´ | ´ | ´ | ´ |
CLIP | ´ | ´ | ||
CMDLINE | ´ | ´ | ´ | ´ |
CMDTEXT | ´ | ´ | ´ | ´ |
COMMAND | ´ | ´ | ´ | |
COMMENTLINE | ´ | ´ | ´ | |
COMMENT_STYLE | ´ | ´ | ´ | ´ |
COMPARE | ´ | ´ | ´ | |
CONDITIONAL | ´ | ´ | ´ | ´ |
COPYLINE | ´ | ´ | ´ | ´ |
COPYTOCMD | ´ | ´ | ´ | ´ |
COUNT | ´ | ´ | ´ | |
CURR_ALT_PFLINE | ´ | ´ | ´ | |
CURR_CTRL_PFLINE | ´ | ´ | ´ | |
CURR_PFLINE | ´ | ´ | ´ | |
CURR_SHIFT_PFLINE | ´ | ´ | ´ | |
CURSOR | ´ | ´ | ´ | ´ |
DATE | ´ | ´ | ´ | ´ |
DELCHAR | ´ | ´ | ´ | ´ |
DELDUPES | ´ | ´ | ´ | ´ |
DELETE | ´ | ´ | ´ | |
DELSYM | ´ | ´ | ´ | ´ |
DELWORD | ´ | ´ | ´ | ´ |
DIAG | ´ | ´ | ´ | |
DOWN | ´ | ´ | ´ | |
DUPLICATES | ´ | ´ | ´ | ´ |
E | ´ | ´ | ´ | ´ |
EA | ´ | ´ | ´ | |
EDIT | ´ | ´ | ´ | ´ |
EOF_TEXT | ´ | ´ | ´ | ´ |
ERASEEOL | ´ | ´ | ´ | ´ |
ERRORS | ´ | ´ | ´ | ´ |
EXCLUDE | ´ | ´ | ´ | |
EXITRC | ´ | ´ | ´ | |
EXPAND | ´ | ´ | ´ | ´ |
EXT | ´ | ´ | ´ | ´ |
EXTRACT | ´ | ´ | ´ | |
FFILE | ´ | ´ | ´ | |
FIELDTEMPLATE | ´ | ´ | ´ | |
FILE | ´ | ´ | ´ | ´ |
FIND_WORD | ´ | ´ | ´ | ´ |
FORWARD | ´ | ´ | ´ | ´ |
FT | ´ | ´ | ´ | ´ |
FUNCWIN | ´ | ´ | ´ | ´ |
GET | ´ | ´ | ´ | ´ |
HELP | ´ | ´ | ´ | ´ |
HEX | ´ | ´ | ´ | |
HIDEFILE | ´ | ´ | ´ |
Command | OS/2 |
Windows NT/95 |
DOS | Unix |
---|---|---|---|---|
INPUT | ´ | ´ | ´ | ´ |
INPUT_ERRORLINE | ´ | ´ | ´ | |
INSMODE | ´ | ´ | ´ | |
JOIN | ´ | ´ | ´ | ´ |
KEY | ´ | ´ | ´ | |
KEYIN | ´ | ´ | ´ | ´ |
KEYIN_NAME | ´ | ´ | ´ | ´ |
KEYS_PLAY | ´ | ´ | ´ | |
KEYS_RECORD | ´ | ´ | ´ | ´ |
KEYS_WRITE | ´ | ´ | ´ | |
L | ´ | ´ | ´ | ´ |
LINECOLOUR | ´ | ´ | ´ | |
LINEFIELDS | ´ | ´ | ´ | |
LINEMACRO | ´ | ´ | ´ | |
LINEND | ´ | ´ | ´ | ´ |
LOCATE | ´ | ´ | ´ | ´ |
MA | ´ | ´ | ´ | ´ |
MACRO | ´ | ´ | ´ | ´ |
MARGINS | ´ | ´ | ´ | ´ |
MARK | ´ | ´ | ´ | ´ |
MATCH | ´ | ´ | ´ | ´ |
MESSAGEBOX | ´ | ´ | ´ | |
MSG | ´ | ´ | ´ | |
MSGMODE | ´ | ´ | ´ | ´ |
NAME | ´ | ´ | ´ | ´ |
NEXT | ´ | ´ | ´ | ´ |
NEXT_ERROR | ´ | ´ | ´ | ´ |
NEXT_FILE | ´ | ´ | ´ | ´ |
NEXT_FUNC | ´ | ´ | ´ | ´ |
NEXT_PARA | ´ | ´ | ´ | ´ |
NEXT_SENTENCE | ´ | ´ | ´ | ´ |
NEXT_SYM | ´ | ´ | ´ | ´ |
NEXT_WORD | ´ | ´ | ´ | ´ |
NOP | ´ | ´ | ´ | ´ |
NUMFILES | ´ | ´ | ´ | |
OPENFILE | ´ | ´ | ´ | ´ |
PAGEDOWN | ´ | ´ | ´ | ´ |
PAGEUP | ´ | ´ | ´ | ´ |
PASSWORD | ´ | ´ | ´ | |
PFLINE | ´ | ´ | ´ | |
PLAYBACK | ´ | ´ | ´ | |
PRESSKEY | ´ | ´ | ´ | |
PREVIOUS_FILE | ´ | ´ | ´ | ´ |
PREVIOUS_FUNC | ´ | ´ | ´ | ´ |
PREVIOUS_PARA | ´ | ´ | ´ | ´ |
PREVIOUS_SYM | ´ | ´ | ´ | ´ |
PREVIOUS_WORD | ´ | ´ | ´ | ´ |
PROMPT | ´ | ´ | ´ | |
PUT | ´ | ´ | ´ | ´ |
Command | OS/2 |
Windows NT/95 |
DOS | Unix |
---|---|---|---|---|
´ | ´ | ´ | ´ | |
QQUIT | ´ | ´ | ´ | ´ |
QUIT | ´ | ´ | ´ | ´ |
REDO | ´ | ´ | ´ | ´ |
REFORMAT | ´ | ´ | ´ | ´ |
REFRESH | ´ | ´ | ´ | ´ |
RENAME | ´ | ´ | ´ | ´ |
REPEAT_FIND | ´ | ´ | ´ | ´ |
REPFIND | ´ | ´ | ´ | ´ |
REPLACE | ´ | ´ | ´ | |
RESOLVE_FN | ´ | ´ | ´ | ´ |
RESTORE_FIND | ´ | ´ | ´ | ´ |
REVERSE_FIND | ´ | ´ | ´ | ´ |
RINGWIN | ´ | ´ | ´ | ´ |
SAVE | ´ | ´ | ´ | ´ |
SCROLL | ´ | ´ | ´ | ´ |
SETRESULT | ´ | ´ | ´ | |
SHADOW | ´ | ´ | ´ | ´ |
SHADOWTEXT | ´ | ´ | ´ | |
SHELL | ´ | ´ | ´ | ´ |
SHOW | ´ | ´ | ´ | |
SHOWLINE | ´ | ´ | ´ | ´ |
SORT | ´ | ´ | ´ | ´ |
SPAN | ´ | ´ | ´ | ´ |
SPLIT | ´ | ´ | ´ | ´ |
SPLITJOIN | ´ | ´ | ´ | ´ |
STATUS | ´ | ´ | ´ | |
STATUSTEXT | ´ | ´ | ´ | |
STYLE | ´ | ´ | ´ | |
SYNTAX | ´ | ´ | ´ | |
TAB | ´ | ´ | ´ | |
TABLINE | ´ | ´ | ´ | ´ |
TABS | ´ | ´ | ´ | |
TIMER | ´ | ´ | ´ | |
TITLE | ´ | |||
TOFEOF | ´ | ´ | ´ | |
TOF_TEXT | ´ | ´ | ´ | ´ |
TOP | ´ | ´ | ´ | ´ |
TOPLINE | ´ | ´ | ´ | ´ |
TOPSCREEN | ´ | ´ | ´ | ´ |
UNDO | ´ | ´ | ´ | ´ |
UNDO_BLOCK | ´ | ´ | ´ | |
UNDO_LIMIT | ´ | ´ | ´ | ´ |
UP | ´ | ´ | ´ | |
WINDOW | ´ | ´ | ´ | ´ |
WINLINE | ´ | ´ | ´ | ´ |
WINSELECT | ´ | ´ | ´ | |
WINSORT | ´ | ´ | ´ | ´ |
WINWAIT | ´ | ´ | ´ | ´ |
WRAP | ´ | ´ | ´ | ´ |
X | ´ | ´ | ´ | ´ |
nnn | ´ | ´ | ´ | ´ |