Command Changes

This chapter gives details of the changes made in KEDIT for Windows 1.5 to KEDIT's commands. Where minor changes have been made to a command, only the changes are discussed here. Where major changes have been made, full documentation of the command is given.

Invoking KEDIT

KEDIT for Windows 1.0 was invoked via the KEDITW command. In KEDIT for Windows 1.5, the KEDITW command is still used with the 16-bit version of the module, but the 32-bit version of the module is invoked via the KEDITW32 command.

Two new initialization options are available in KEDIT for Windows 1.5:

LINE n

The LINE option tells KEDIT that, as soon as the file is loaded, the specified line of the file should become the current line.

An example:

KEDITW32 SAMPLE.FIL (LINE 62
This invokes the 32-bit version of KEDIT for Windows. It tells KEDIT to begin editing SAMPLE.FIL and to start with line 62 as the current line.

The LINE option does not affect the cursor position; the cursor is left on the command line and is not automatically moved to the current line. However, you can use the COLUMN option to move the cursor to a specified column of the current line.

COLumn m

The COLUMN option tells KEDIT that, as soon as the file is loaded, the cursor should be moved into the file area to the specified column of the current line. The current line is initially set to the line specified via the LINE option, or to the Top-of-File line if the LINE option is not used. An example:
KEDITW32 SAMPLE.FIL (LINE 62 COLUMN 12
This invokes the 32-bit version of KEDIT for Windows. It tells KEDIT to begin editing SAMPLE.FIL and to start with line 62 as the current line, with the cursor positioned in column 12 of that line.

ALTER, CHANGE, COUNT, SCHANGE

Format

ALter char1 char2 [target [n [m]]]
Change /string1/string2/ [target [n [m]]]
COUnt /string/ [target]
SCHange /string1/string2/ [target [n [m]]]

Changes

When issued from a macro, the ALTER, CHANGE, COUNT, and SCHANGE commands now return information to the macro:

CLIPBOARD

Format

CLIPboard COPY|CUT|PASTE
CLIPboard APPEND CUT|COPY
CLIPBoard PUT text
CLIPBoard APPEND PUT text
CLIPBoard CLEAR

Changes

CLIPBOARD APPEND CUT|COPY, PUT, APPEND PUT, and CLEAR are new in KEDIT for Windows 1.5, and CLIPBOARD CUT and COPY have been changed to allow text to be cut or copied from the file area if the cursor is on the command line and there is no command line selection.

Description

The CLIPBOARD command moves data to or from the Windows clipboard. It is used mainly in the macros that handle the clipboard related items on the Edit menu, and in their toolbar and keyboard equivalents.

CLIPboard COPY

If the cursor is on the command line, the contents of the command line selection are copied to the clipboard, replacing any previous contents of the clipboard. If there is no command line selection, KEDIT will instead copy the currently marked block to the clipboard. Command line selections are possible only if INTERFACE CUA is in effect.

If the cursor is in the file area, the contents of the currently marked block are copied to the clipboard, replacing the previous contents of the clipboard. An error message is displayed if there is no block marked in the current file.

The Edit Copy menu item, the Copy to Clipboard toolbar button, Ctrl+Delete, and (if INTERFACE CUA is in effect) Ctrl+C all issue the CLIPBOARD COPY command.

CLIPboard CUT

This does the same thing as CLIPBOARD COPY (that is, it copies the contents of a marked block or command line selection to the clipboard), and then it deletes the data involved from your file or from the command line.

The Edit Cut menu item, the Cut to Clipboard toolbar button, Shift+Del, and (if INTERFACE CUA is in effect) Ctrl+X all issue the CLIPBOARD CUT command.

CLIPboard PASTE

If the cursor is on the command line, data from the clipboard is copied to the KEDIT command line at the cursor position, replacing any existing command line selection. You can only paste a single line of text from the clipboard to the command line. If there are multiple lines of text in the clipboard, attempts to paste to the command line will cause an error message. Any tab characters in data pasted to the command line are changed to blanks.

If the cursor is in the file area, data from the clipboard is copied into your file. If INTERFACE CUA is in effect and you have just marked an anchored block (that is, marked a block with the mouse or with Shift+cursor-pad-key), KEDIT first deletes the block, then positions the cursor at the location of the deleted block, and then inserts the clipboard's contents at that location. Otherwise, KEDIT inserts the marked block at the cursor position.

If the clipboard data came from a KEDIT stream block, from a KEDIT command line selection, or from some application other than KEDIT for Windows, it is inserted into your file at the cursor position as a stream of text. If the data came from a KEDIT box block, it is inserted at the cursor position as a rectangular section of text. If the data came from a KEDIT line block, it is inserted below the cursor line as a group of new lines.

Tab characters in clipboard data pasted into your file from other applications are expanded to blanks. If TABSIN OFF is not in effect, KEDIT does this according to the current TABSIN column settings; otherwise KEDIT uses the current SET TABS columns.

The Edit Paste menu item, the Paste from Clipboard toolbar button, Shift+Ins, and Ctrl+V all issue the CLIPBOARD PASTE command.

CLIPboard APPEND CUT
CLIPboard APPEND COPY

If there is no text in the clipboard, these commands have the same effect as CLIPBOARD CUT and CLIPBOARD COPY. Otherwise, these commands append the contents of the current selection to the existing clipboard text.

If text is already in the clipboard and it does not end in a new line sequence (a carriage return and a linefeed), these characters are added to the existing clipboard text before the contents of the selection are appended.

CLIPboard PUT text
CLIPboard APPEND PUT text

CLIPBOARD PUT and APPEND PUT let you modify the contents of the clipboard from within a KEDIT macro. The specified text replaces, or is appended to, any existing text in the clipboard.

For CLIPBOARD APPEND PUT, if text is already in the clipboard and it does not end in a new line sequence (a carriage return and a linefeed), these characters are added to the existing clipboard text before the new text is appended.

CLIPboard CLEAR

The clipboard is emptied of any data that it contains.


CMATCH

Format

CMATCH [OUTER|INNER]

Changes

CMATCH now works with the syntax coloring facility to properly account for braces, parentheses, etc. in comments and quoted strings. CMATCH can also now handle matching keywords, such as DO -- END pairs, in languages where these are highlighted by the syntax coloring facility.

Description

Use the CMATCH (``column match'') command to find a parenthesis, brace, or bracket that matches the character in the focus column. When you work with programming languages like C that make frequent use of balanced pairs of braces and parentheses, the CMATCH command can help you verify that matching braces and parentheses are properly positioned.

CMATCH is most useful when assigned to a key or to a toolbar button, so that if you press the key with the cursor positioned on, for example, a left parenthesis, the cursor will move to the matching right parenthesis. By default, the CMATCH command is assigned to Shift+F3.

If the character at the focus column is a ``{'' or ``}'', the CMATCH command moves the focus column to the matching ``}'' or ``{''. The same thing happens with ``('' and ``)'', with ``['' and ``]'', and with ``<'' and ``>''.

If you are working in a file with syntax coloring enabled and you are using a parser that defines matching items like parentheses, the CMATCH command will properly handle nested pairs of matching items and will skip over text in quotes or in comments.

If syntax coloring is not enabled, or if the active parser does not handle the item at the focus column, CMATCH will still handle nested pairs of parentheses, braces, and brackets, but will not properly handle parentheses, braces, and brackets inside comments or quotes.

CMATCH can also handle matching keywords that are defined in a syntax coloring parser. For example, in a KEXX macro containing the following:

if a = 5 then do
  j = 17
  do i = 1 to 10
   say i*j
  end
end
you can place the cursor on the DO at the end of the first line and press Shift+F3 to move the cursor to the corresponding END in the last line.

The OUTER and INNER operands control what happens with matching items for which the syntax coloring parser has defined beginning, middle, and end elements. With CMATCH OUTER and CMATCH with no operands, the cursor will move between the beginning and end elements. With CMATCH INNER, the cursor will move to the next beginning, middle, or end element.

For example, in the following C code each of #if, #elif, #else, and #endif are highlighted by the syntax coloring facility:

#if defined(a)
  x = 17;
#elif defined(b)
  x = 19;
#else
  x = 20;
#endif
If the cursor is positioned on any of these items, CMATCH OUTER and CMATCH with no operands will move the cursor to the next outer element. If the cursor is on #if, #elif, or #else, it will move to #endif. If the cursor is on #endif, it will cycle back to #if.

With CMATCH INNER, the cursor will stop at inner items as well as outer items, moving from #if to #elif to #else to #endif and back to #if again.


DEFINE

Format

DEFine macroname macrodefinition
DEFine macroname
DEFine fileid

Changes

The following additional key combinations are definable in KEDIT for Windows 1.5:
Ctrl+;
Ctrl+'
Ctrl+,
Ctrl+.
Ctrl+/
Ctrl+`
Ctrl+Star
Alt+Star
App
Ctrl+App
Shift+App
Alt+App
`
Shift+`
Alt+`
The ``App'' key is the Application key found on some newer Windows-specific keyboards. The last three key combinations in the list were actually available in KEDIT for Windows 1.0, but were mistakenly omitted from the documentation.

DIR

Format

DIR [filespec ...]

Changes

KEDIT for Windows 1.0, and the 16-bit version of KEDIT for Windows 1.5, set aside 8 columns in the DIR.DIR file to display the file name and 3 columns to display the file extension. To allow for the long filenames available under Windows 95/98/NT/2000/Me/XP, the 32-bit version of KEDIT for Windows 1.5 by default sets aside 30 columns to display the file name and 10 columns to display the file extension. You can use the SET DIRFORMAT command to control this.

FILL, FILLBOX

Format

FILL [char]
FILLbox [char]

Changes

The FILL command can now be used to fill line and stream blocks, as well as box blocks, with copies of a specified character. In previous versions of KEDIT, only box blocks could be filled. Because of this change the FILLBOX command has been renamed to the FILL command, although FILLBOX will still work.

OVERLAYBOX

Format

OVERLAYBox

Changes

The OVERLAYBOX command, normally assigned to Shift+Ctrl+O, overlays a portion of your file with the text in a block. In KEDIT for Windows 1.0, OVERLAYBOX only worked with box blocks, but it now works with line blocks, box blocks, and one-line stream blocks. It does not work with multi-line stream blocks. (The OVERLAYBOX command would have been renamed to OVERLAY, except that KEDIT already has a rarely-used command by that name.)

POPUP

Format

POPUP [MOUSE|TEXT|CENTER] /item1/[item2/ ...]

Changes

The first, optional, operand is new in KEDIT for Windows 1.5. It determines where the pop-up menu appears. If MOUSE is specified, or if the operand is omitted, the upper left corner of the menu is positioned at the mouse pointer location. With TEXT, the upper left corner is positioned at the text cursor location, and with CENTER the upper left corner is positioned at the center of KEDIT's frame window.

PUT, PUTD

Format

PUT [target [fileid]]
PUTD [target [fileid]]

Changes

In KEDIT for Windows 1.0, the PUT and PUTD commands left the last line written to disk as the focus line if STAY OFF was in effect. In KEDIT for Windows 1.5, PUT and PUTD with STAY OFF in effect instead make the line after the last line written to disk become the focus line.

READV

Format

READV Cmdline [initial]
READV EDITfield [initial]
READV KEY [Ignoremouse|NOIgnoremouse]

Changes

In KEDIT for Windows 1.0, READV CMDLINE actually read from an edit field in a pop-up dialog box. In KEDIT for Windows 1.5, READV CMDLINE reads from the KEDIT command line, as it did in text mode KEDIT. You can use the new READV EDITFIELD operand if you want to read from an edit field in a dialog box.

Prefix Commands

Prefix commands to uppercase (U, UU) and lowercase (L, LL) text have been added in KEDIT for Windows 1.5.
KEDIT Home Page
KEDIT Overview | Download Libraries | Maintenance Releases
Ordering/Licensing | Demo Version | Technical Support | What's New
KEDIT for Windows 1.6.1 Upgrade | KEDIT Mailing List

Copyright © 1996-2012 Mansfield Software Group, Inc.