KEXX Macros

contents external
Introduction Contents Site map Contact
REXX links Details Directory Sources

top   Introduction

Kedit is a clone of XEDIT, the good old IBM mainframe editor, for DOS and OS/2 text mode (no GUI).  The Windows versions KeditW are integrated into the Windows GUI, so some things are different.  Almost all macros are tested with Kedit 5.00p4 for DOS and OS/2.  Most macros should also work with KeditW 1.0 INTERFACE CLASSIC unless the macro header says something else, e.g. Requires: Kedit 5, OS/2 REXX.  THE is another XEDIT clone for many systems (incl. Linux with Regina), and some macros might even work with THE or XEDIT. Please note that none of these macros is designed for EBCDIC, you get what you pay for... ;-)

XEDIT, Kedit, and THE all use REXX as macro language.  Kedit supports its own subset KEXX and some native REXX interpreters.  Most of my macros are based on KEXX.  If REXX is required in older macros there should be an info in the macro header.  Likewise if external tools are required it is stated in the macro header.

All kml files are Kedit Macro Libraries, plain text like kex macros, no "Keyhole Markup Language" used by Google Earth.  Let's hope that my server and your browser handle these files as plain text.  If this doesn't work copy the files to your disk (try Shift Enter on the desired link).

top   Contents

Short descriptions of most macros are simply copied from khelp.kex.  Entries marked by CP 858 use eight-bit characters (codepage 437, 850, or 858).  Entries marked by * (asterisk) are either used explicitly as macro or synonym replacing a Kedit command, or conflict in another way with a KHELP manual entry.  In these cases khelp.kex offers to show the manual entry or the context help for the macro.

A-X.kml (example Kedit Macro Library redefining Alt-X)   2003
BASE insert <base href="URL" /> in local XHTML copy 2006
BINARY edit binaries using LRECL based on window width 2008
BOX draw BOXes (9 styles, use keypad or box block)
CDD CHD + CHDR like 4DOS CDD supporting *.DIR items
CDEFG show biggest files (top 1000) in DIR.DIR file
CHANGES CHANGE all occurences on line, not only first   2008
CLIPS W2K ooREXX CLIPS.REX interface using GET & PUT 2008
CLIPS.rex (ditto used ooREXX script, 95/98/ME not tested)   2008
CMATCH  * match REXX "do end" or HTML "<div> </div>" etc. 2008
COLOR  * INITIAL.KEX calls COLOR by 'macro' monitor.1()   2008
COLOR2 Old (1995-2005) colour scheme for younger eyes 2008
COUNTS COUNT string in BLOCK / ALL lines ignoring CASE   2004
CURSORSH  * improved CURSORSHape based on CURSORSHape auto 2009
DELIMIT  * check and optionally patch a broken delimit()   2008
DO  * placeholder (optional DOwn compatible synonym)   2008
DOS.kml INITIAL.KEX loads Kedit Macro Library DOS.KML   2008
EURO check char.s not contained in ASCII 32..126 & 9
EX  * run arguments with temporarily SET LINEND ON ; 2008
EXTRACT  * EXTRTEST clone, supports = and abbreviations   2008
FEATURES Kedit 5.00 (D3/P3) bug list and workarounds   2008
FMODE  * MODify or SET FE, FM, FN, FP, FT, or FILEId   2008
HEX  * show visible ASCII char.s (overloading SET HEX)   2010
HEXA hex. editor (show and maybe even patch binary)   2008
HEXE (ditto squeezing 24 octets in window width 80)   2008
HREF convert URL (focus word) to dummy XHTML link
HTM edit *.htm or *.html in homepage directory   2003
INISAVE  * INIUTIL CONVERT SETTINGS if no argument given   2008
INISET saved INIUTIL CONVERT SETTINGS output as backup 2008
INITIAL  * PROFILE.KEX calls 'macro initial' if INITIAL()   2008
INITIAL.kml (ditto used Kedit Macro Library)   2008
INT locates a topic in Ralf Brown's INTERRUP.LST 2010
KC KCOMPARE clone (resetting special keys at exit) 2008
KEX Kedit macro using MACROPATH (or its definition)   2008
KEXPAND expand commands, needed for KHELP.KEX & KEX.KEX 2008
KEXPATH MACROPATH search needed for KHELP.KEX & KEX.KEX 2008
KEYDIFF determine all reDEFINEd (non-default) keys   2008
KEYMAP patch missing STAR keys in KEDIT binary 2009
KHELP  * KHELP.KEX allows normal 'command khelp khelp'   2008
KHELPADD KHELP.kex and xedit.htm maintenance (3 tables) 2008
KTAGS XTAGS clone (supporting TABs and Unix tags)
LASTKEY  * Kedit key decoder (showing name and definition)   2008
LASTRC  * improved QUERY LASTRC (preserves error message)   2008
LESSMORE used as synonym for LESS TAG and MORE TAG issue
LOCUS locate target in any currently edited file
LONGEST locate and tag longest line(s) in edited file
MONITOR  * combines [set] MONitor and 'macro' monitor.1()   2008
MONO INITIAL.KEX calls MONO by 'macro' monitor.1()   2008
MSGLINE  * explores KeditW SET MSGLINE message box effects   2008
MUSTARD RFC 2119 keywords (MAY, MUST, SHOULD, etc.)   2006
NBSP convert blanks in marked block to XHTML &#160; 2003
NETSCAPE view the focus URL with your favourite browser   2008
OEMKEY.kml overload INITIAL.KML keys with KEYB GR keys   CP 858
PROFILE  * KHELP.KEX allows normal 'command khelp profile'
QX simplified XQ.KEX and RELOAD.KEX samples macros  
REXX edit REXX script or copy REXXTRAP.CMD stuff
REXXTRAP update REXXTRAP.CMD functions in *.CMD scripts   2008
RING  * DIR currently edited files TAGging modified
RW force write access on edited read-only file
RXHELP REXX context help (OS/2, PC DOS 7, ooREXX 4.01)   2010
STATUS  * mini status: only relevant non-default settings
TALL Two lines context before/after ALL selected 2010
TIME  * show elapsed time for specified command
TRACE  * DEBUG manager (keys, debugging, RXTRACE, etc.) 2008
TREE corrected sample supporting long and HPFS id.s 2008
UNBLANK get rid of blank lines with even line numbers
UNESCAPE experimental: JavaScript decoder
UNIX raw text mode based on EOLIN LF etc. settings   2004
UTF hex. UTF-32 or UTF-16 to hex. UTF-8 and UTF-16   2008
VI.cmd NT: KeditW long file name, support associations   2008
VI NT: Kedit 8+3 file name given as long file name   2008
WINDOWS KeditW: could be called by 'macro' monitor.1()   2008
WINHELP  * DIR.DIR list *.HLP for KeditW command WINHELP   2008
WMSG  * emulates KeditW 1.0 command WMSG with a DIALOG   2008
X-WIKI profile for text/x-wiki translates UTF-8 to NCR   2006
XD Update file listing, can be used in makefiles 2010
XDIR MANYFILE clone (corrected)
XHTML convert plain text (code page 850) to XHTML 1.0   CP 858
XLAT 858, 1252, UTF-4, UTF-8, and UTF-16 conversions   2010
XLAT.rex (ditto used external REXX script)   2008
XMLCHECK check that XML or XHTML file is well formed XML   2008
XPM check, simplify, or convert XPM2 & XPM3 images 2010
XTREE DIR all subdirecories TAGging empty directories
XX XEDIT file with name completion (DIR ambiguous)
ZIP          edit preselected files (e.g. here: ZIP manuals)
ZOO          absolute ZOne Offset navigation, e.g., binaries   2008

The following macros are contained in initial.kml and also covered by khelp.kex:

DAY display date + weekday, any arg.: input as line  
DOSX edit redirected standard output of OS command  
LASTMSG  *  like QUERY LASTMSG, but in DIALOG (word wrap)  
NAME change filename and rename a corresponding file  
SAY  *  display persistent result of REXX expression  
START shorthand for NT 'winexec nowait' or for OS/2   2010
UNTITLED shorthand / emulation of KeditW 'x (untitled)'   2008
WO locate word in any edited file (uses LOCUS.kex)  
XID         x =:=\x.= or x =:=\x.y, for XID .y edit =:=\=.y   2008

The following macros were parts of initial.kml and are now external files, i.e., not more kept in memory.

A-FXI A-F11: (try to) toggle 25/28/43/22 lines 2010
A-FXII A-F12: toggle hex., binary, and default views     2010
A-VIEW A-V: view any block, jump from end to end 2010
C-NUMBER C-N: count char.s in strings on current line 2010
C-SHADOW C-S: use 'LPREFIX S' to expand shadow lines 2010
C-WORD C-W: upper/lower/title case for field word 2010
DOSMOUSE        Helper for KEDIT 5 MOUSETEXT operations 2010

Some older macros together with related OS/2 specific scripts are archived in (22 KB) and generally not more covered by khelp.kex, exceptions are clips.kex and utf.kex:

ANSIFY translate ISO Latin 1 to Codepage 437 (or 850)   CP 858
BROWSE document browser (temporarily wrap long lines)
BROWSE.cmd (simple OS/2 REXX script using BROWSE.KEX)   2006
CHCP Optionally set and get process codepage (OS/2)   2006
CLIPS_os2.kex OS/2 WPS clipbrd.exe interface using GET & PUT
ENV like DOS SET, but modifying Kedit's environment   CP 858
HEXE.cmd (simple OS/2 REXX script using HEXE.KEX) (example KHELP.PROfile mentioned elsewhere)
MBOXREF replace In-Reply-To: by References: in mbox   2003
NMK edit redirected output of NMAKE /f xyz.NMK xyz
OUTBOX.cmd (OS/2 script: edit last Outbox message with EX)   2004
PSCREEN.rex initial PSCREEN size depending on any MODE CON   2008
SETLINES switch PSCREEN rows and columns, needs setlines
SETLINES.bat (ditto NT emulation, does not work with KEDIT)   2008
SUBJECT encode CP 850 Subject: header as base-64 UTF-8
TRASH Netscape mailbox directory TREE (excl. *.snm)
TV remove base64 TV (= MZ) binaries from mbox file   2003
RXHELP3.kex REXX context help (OS/2, PC DOS 7, ooREXX 3.2)   2008
UTF_os2.kex (old OS/2 UTF.KEX variant, needs external REXX)   2006
X.cmd    (simple OS/2 REXX script: KEDIT command)
X-WIKI.cmd (simple OS/2 REXX script using X-WIKI.KEX)   2006
XC.rex (REXX: edit stdout & stderr of command with EX) 2008
XDROP.cmd (simple OS/2 REXX script: KEDIT drag & drop)
XEDIT.cmd (simple OS/2 REXX script: KEDIT association)
XX.cmd (simple OS/2 REXX script using XX.KEX)

top   Details

Sorry, I still hadn't the time to write more about this Kedit macro collection, but eventually got around to test most macros with KeditW 1.0 in 2008.  Please tell me (contact) if you are using some of this stuff, I could add a more sophisticated version management than "Check the timestamps in the kex directory".

For xhtml.kex see also the example, the output of xhtml.kex applied on itself.  Separate manual pages exist for ktags.kex contained in (40 KB) and for kc.kex contained in (50 KB).

For details about the classic REXX REXXTRAP.cmd see the REXXTRAP manual page with short entries for REXX.kex and REXXTRAP.kex, i.e. the Kedit macros REXX and REXXTRAP.  However, for ooREXX this collection of portable REXX snippets is mostly obsolete.

Kedit 5.0 for DOS has some ugly limitations, e.g., at most 500 lines per macro.  Because various subroutines were used almost identically in kex.kex, khelp.kex, and trace.kex these parts have been now exported into two separate macros kexpath.kex and kexpand.kex.  Both can be also used directly, but their main purpose is to simplify MACROPATH searches and the expansion of abbreviated commands in other macros.

In features.kex I have noted many Kedit 5.0 features, bugs, and workarounds over the years.  Some issues are fixed in KeditW 1.0 and moved to the end of features.kex.  In 2008 I found the last (one hopes) Kedit oddity, it is documented in the fixed euro.kex.

If you have Kedit 5.0 get and install the last update P4 for OS/2 or D4 for DOS.  In features.kex you find instructions how to patch the binaries of this version.  The patches enable support for key 150 C-STAR, 55 A-STAR, and 114 S-STAR.  The latter is the traditional name for AT-keyboard layouts with 84 keys, you have to press Ctrl+PrtSc on modern keyboards with 101 or more keys for S-STAR instead of Shift+Star.  Maybe Mansfield forgot these keys because both the shifted and the unshifted Star of the numeric keypad simply result in * (star).

Another patch proposed in features.kex fixes an issue with the KEXX-function delimit().  Under certain circumstances this function would use *, =, ?, or ~ as delimiter, but these characters don't work as delimiter for some kinds of locate-targets.  The proposed patches work also with Kedit 5.0 P3 and Kedit 5.0 D3, but a later upgrade to version P4 or D4 needs the original binaries.

Nobody is going to create a D5 or P5 service level 5 for Kedit 5.0, therefore I removed all ideas for future improvements and fixes from features.kex, and added some undocumented KeditW 1.0 features.  For a short list of less esoteric features see the introduction (comments) of kexpand.kex.

top   REXX links

W3 validator Last update: 16 Mar 2011 05:30 by F.Ellermann