WN_mac10.txt

This document describes the macros contained in the file WN_mac10.mac,
which were originally written by John Goodman.
They were rewritten to work well for UltraEdit version 10.10c and higher.

Note: If a macro uses copy, cut and/or paste commands, it uses Clipboard 9
      to prevent overwriting previously copied data in the Windows Clipboard.

The macro library can be loaded by using the "Macro->Load" or
"Macro->Load and Append to Existing..." menu options in UltraEdit.
The default hot key assignments are provided in parentheses and can be
changed using the "Macro->Delete Macro/Modify Properties..." menu option.


CmmtC++ThisLine  (Ctrl + /)

    If text is selected, it makes the block C++-comment by inserting
    "/* " at the beginning and " */" at the end of the block, otherwise
    it makes the current line a C++-comment line by inserting "/* " in
    front of the first nonwhite character and " */" at the end of the line.
    The cursor is always positioned after the "/* ".
    For example:

    1.  Lines before invoking macro ('fprint' until '= 4;' selected):
             fprintf(stdout, "Debug: SubTotal fixed on 4");
             SubTotal = 4;
             GrandTotal += SubTotal;

        Lines after invoking macro (cursor on 'fprint'):
             /* fprintf(stdout, "Debug: SubTotal fixed on 4");
             SubTotal = 4; */
             GrandTotal += SubTotal;


    2.  Line before invoking macro (no text selected):
             GrandTotal += SubTotal;

        Line after invoking macro (cursor on 'GrandTotal'):
             /* GrandTotal += SubTotal; */


CmmtC++AboveLine  (Alt + /)

    This macro adds a blank C++-comment line above the current line.
    The beginning of the comment line is aligned with the original line
    and the cursor is positioned right in the middle. For example:

    Line before invoking macro:
         GrandTotal += SubTotal;

    Lines after invoking macro (cursor position = |):
         /* |*/
         GrandTotal += SubTotal;


CmmtCobThisLine  (Ctrl + 8)

    This macro makes the current line a COBOL-comment line by changing
    position 7 to "*" if it is blank, else by inserting "*" there.
    If position 7 already is "*", the line isn't changed.
    The cursor is always positioned on the next line. For example:

    Line before invoking macro (cursor is on first line):
                ADD RecordTotal TO SubTotal.
                ADD SubTotal TO GrandTotal.

    Line after invoking macro (cursor position = |):
          *     ADD RecordTotal TO SubTotal.
           |    ADD SubTotal TO GrandTotal.


CmmtCobAboveLine  (Alt + 8)

    This macro adds a blank COBOL-comment line above the current line
    and the cursor is positioned at the end of the new comment line.
    For example:

    Line before invoking macro:
                ADD SubTotal TO GrandTotal.

    Lines after invoking macro (cursor position = |):
          * |
                ADD SubTotal TO GrandTotal.


CmmtTalThisLine  (Ctrl + -)

    This macro changes selected text to TAL-comment by inserting "; -- "
    in front of the block, or, if no text is selected, "-- " in front of
    the first nonwhite character. The cursor is positioned after the "-- ".
    For example:

    1. Line before invoking macro ('+ SubTotal' selected):
            GrandTotal := RecTotal + SubTotal;

       Line after invoking macro (cursor on '+'):
            GrandTotal := RecTotal ; -- + SubTotal;

    2. Line before invoking macro (no text selected):
            GrandTotal := RecTotal + SubTotal;

       Line after invoking macro (cursor on 'GrandTotal'):
            -- GrandTotal := RecTotal + SubTotal;


CmmtTalAboveLine  (Alt + -)

    This macro adds a blank TAL-comment line above the current line.
    The beginning of the comment line is aligned with the original line
    and the cursor is positioned at the end of the new comment line.
    For example:

    Line before invoking macro:
         if filecode <> 0 then call error^on^file;

    Lines after invoking macro (cursor position = ^):
         -- ^
         if filecode <> 0 then call error^on^file;


Duplicate  (Ctrl + D)

    If no text has been selected, it copies the current line and positions
    the cursor on the first nonwhite character of the second line, else it
    copies the selected text and selects the copy. This allows to repeatedly
    use Ctrl + D and get the same processing.


JoinLines  (Ctrl + J)

    This macro appends the line following the current line to the end of
    the current line with a single space between them and positions the
    cursor at the first non-whitespace character.


LineAlignCursor  (Ctrl + F7)

    This macro aligns the beginning of the current line to the current
    cursor position and moves the cursor to the next line, so you can
    align a series of lines by repeatedly hitting the hot key.

    Note: You may need to set option "Allow Positioning Beyond Line End".


LineAlignPrev  (Alt + F7)

    This macro aligns the beginning of the current line to the beginning
    of the previous line and moves the cursor to the next line, so you
    can align a series of lines by repeatedly hitting the hot key.


PosFirstNonWhite

    Positions the cursor at the first nonwhite, non-tab character of the
    current line. This could be done by using the HOME-key, but that only
    works if option "Home Key Always Goto Column 1" has not been set.