* * CMDCOPY.KEX * * KEDIT macro to copy the currently marked one-line box or stream block to * the command line. * * Requires that a stream or box block be marked and that the cursor is * positioned on the command line where the block is to be copied to. * * This macro will copy the block contents to the command line and either * insert or overlay the block where the cursor is in the command line, * depending on whether Insert mode is ON or OFF. * * Works with: * * KEDIT for Windows 1.5 * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * * (Note: If you are using KEDIT for Windows then you can accomplish the same * task as this macro by copying the block to the clipboard and then pasting * it to the command line.) * * Add the following in your KEDIT profile: * * if initial() then do * "define cmdcopy.kex" * * Specify any key you want. F9 is an arbitrary choice. * "define f9 'macro cmdcopy'" * end * * Restart KEDIT to execute your updated profile. Now mark a one-line box or * stream block, position the cursor on the command line and press F9. * * Original author: Sara Rogers, Mansfield Software Group, 8/92. * Last update: 8/96 by Kent Downs, MSG. * if block.1() = 'NONE'| block.1() = 'LINE' then do 'emsg CMDCOPY Error 1: You must have a box or stream block marked' exit 1 end if block.2() \= block.4() then do 'emsg CMDCOPY Error 2: The block is longer than 1 line' exit 1 end if block.6() \= fileid.1() then do 'emsg CMDCOPY Error 3: The marked block is not in the current file' exit 1 end * To force the cursor to column 1 of the command line, un-comment the * next line * "cursor cmdline" if \command() then do 'emsg CMDCOPY Error 4: The cursor must be on the command line' exit 1 end if version.1() = "KEDIT/WINDOWS" then do "text" block.8() exit 0 end * Name the existing current line so we can reposition the file to that line 'point .current' * Make the block become the new current line ':'block.2() * Enter text that is in the block at the cursor location 'text' substr(curline.3(), block.3(), block.5() - block.3() + 1) * Reposition the file to the old current line '.current' exit 0