* CENT11.QM, v1.1a July 18, 1991 * Macros to Center Lines, Paragraphs and Documents * Written by Tom Hogshead * With Macro Contributions by John Goodman and Kyle Watkins * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴[ (INDEX) ]컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커 * � * � @(1) Centers line, moves to next line |chg * � @(2) Centers paragraph, moves to next paragraph |chg * � @(6) Centers entire document (Written by John Goodman) |chg * � @(5) Center Current Line or Lines Delineated by Any Block |new * � (Written by John Goodman) * � @(8) Center Line(s) Delineated by Any Block (or Current Line |new * � if No Blocks Marked) within User-Prompted Right Margin * � (Does not Reset QEdit Right Margin Setting) * � (Written by John Goodman) * � @(4) Centers line after typing (Written by Kyle Watkins, SemWare) * � (same as greyenter, except for use with NON-enhanced keyboards) * � (greyenter) Centers line after typing (Kyle Watkins, SemWare) * � (for use with enhanced keyboards only) * � * 읕컴컴컴�[ be sure to leave at least one blank line at end of Index ]컴컴컴� * Version History: * * 1.0a -added greyenter to center line after typing, from Kyle Watkins, * SemWare, for use with enahanced keyboards only. * 1.0b -added @4 to center line after typing, from Kyle Watkins, * SemWare, for use with NON-enhanced keyboard. * 1.0c -Change file name CENTER10 to CENT11. * 1.0d -Changed documentation * 1.0e -Changed documentation * 1.0f -Changed documentation and added START.BAT. * -Changed CENTER file names to CENT. * 1.1 -Removed @3, replaced with @6 (J Goodman) which does the same * thing but much faster and smoother. * -Added @5 to Center Current Line or Lines Delineated by Any * Block (J Goodman) * -Modified @1/2/6 per John Goodman * -Added @8 to center lines with user prompted right margin, * Written by John Goodman. * 1.1a -Minor documentation changes * For other macros, see ALLMACRO.INF. For macros to remove centering * by deleteing leading space in front of lines, blocks and paragraghs * see DELSPxx.QM. * These macros require "QEdit and QMAC v2.1, February, 1990" or later. * * To BEGIN, just type "START CENT" . All pertinent files will be * loaded in the "Ring" for viewing, and CENT11.MAC is read. * Alternatively, type "START CENT 0" and the disk copies of all * files in the "Ring" will be loaded ready for editing, saving time. *  * ------------------------- * @(1) Center Current Line * ------------------------- * This macro centers the line in which the cursor is currently * positioned and moves to the next line. * @1 MacroBegin UnmarkBlock * Make sure no column or multi-line blocks CenterLine * Center current line only CursorDown * Move to next line to do again * * 6 bytes Sat 08-25-1990 12:13:33 * 7 bytes Wed 05-15-1991 10:29:43 (JG/TH) *  * ------------------------------ * @(2) Center Current Paragraph * ------------------------------ * This macro centers the lines in the paragraph in which the * cursor is currently positioned (or the previous paragraph * if the cursor is on a blank line) and moves to the next * paragraph. * @2 MacroBegin UnmarkBlock * Ensure no blocks marked CursorDown PrevPara * Move to 1st line of current para MarkLine * Start line block NextPara * Move to 1st line of next para CursorUp * Move up one line CenterLine * Center lines in current para UnmarkBlock * Remove block CursorDown * Move to next para MakeCtrofScreen * Align better on screen * * 18 bytes Sat 08-25-1990 12:13:44 * 14 bytes Wed 05-15-1991 10:36:51 (JG/TH) *  * ---------------------------------------------------------------------- * @(4) Center line after typing, from Kyle Watkins, Semware * ---------------------------------------------------------------------- * * In case you do not have an enhanced keyboard, you may want to use * the following macro instead of greyenter at the end: * @4 macrobegin centerline endline return * * 7 bytes Sun 08-26-1990 03:08:09 *  * ------------------------------------------------------------- * @(5) Center Line(s) Delineated by Any Block (or Current Line * if No Blocks Marked), John Goodman, author * ------------------------------------------------------------- * This macro centers all lines bound by block begin and end * positions. Any type of block (character, line, or column) may * be used to delineate the line(s) and only one block marker need * be set. If no block markers are set, the current line is * centered. The cursor will be placed on the line following the * last one centered so that the macro can be invoked repeatedly * to center a series of lines. * @5 MacroBegin CursorRight * Needed for single-line blocks GotoBlockEnd * Try going to block end, retain pos. JTrue BLK: * Determine if a completed block DropAnchor * If not, DropAnchor will finish it * or mark current line if none started GotoBlockEnd * Go to block end to retain position BLK: GotoBlockBeg * Start at the 1st line MarkLine * Mark first line PrevPosition * Return to where block ended CenterLine * Center the Blocked Lines UnmarkBlock * Unmark the block CursorDown * Goto Next Line to Do Again BegLine * * 17 bytes Fri 04-19-1991 17:23:18 * 18 bytes Wed 05-15-1991 11:03:25 (JG) *  *------------------------------------------------- * @(6) Center Entire Document * (Written by Tom Hogshead and John Goodman *------------------------------------------------- * This macro centers every line in the file currently being edited. * @6 MacroBegin UnmarkBlock * Ensure No Blocks Marked EndFile * Goto End of File MarkLine * Start Line Block BegFile * Goto Begin of File CenterLine * Center All Blocked Lines UnmarkBlock * Clean Up * * 11 bytes Fri 04-19-1991 17:34:59 * 10 bytes Wed 05-15-1991 11:30:04 (JG/TH) *  * ------------------------------------------------------------- * @(8) Center Line(s) Delineated by Any Block (or Current Line * if No Blocks Marked) within User-Prompted Right Margin * (Does not Reset QEdit Right Margin Setting) * (Written by John Goodman) * ------------------------------------------------------------- * This macro centers lines between column 1 and a right margin * entered by the user at the "Goto column" prompt. Lines that are * longer than the column number entered by the user will be shifted * all the way to the left. Any type of block (character, line, or * column) may be used to delineate the line(s) and only one block * marker need be set. If no block markers are set, the current line * is centered. The cursor will be placed on the line following the * last one centered so that the macro can be invoked repeatedly to * center a series of lines. This macro does not reset the QEdit * right margin setting normally used to center or wordwrap lines. * @8 MacroBegin CursorRight * Needed for single line block GotoBlockEnd * Try going to block end, retain pos. JTrue BLK: * Determine if a completed block DropAnchor * If not, DropAnchor will finish it * or mark current line if none started GotoBlockEnd * Go to block end to retain position MarkLine * Mark first line BLK: * Line block now set BegLine * Go to begin of last line GotoBlockBeg * Go straight up to 1st line of block MarkColumn * Start column block PrevPosition * Return to last line of block BegLine * Make sure we're in col 1 GotoColumn * Prompt user for right margin Pause Return CenterLine * Centerline will now del leading spaces UnmarkBlock * Unmark the block BegLine * Go to begin of last line CursorDown * Move to next line to do again! * * 24 bytes Tue 06-25-1991 18:55:41 (JG) *  * ---------------------------------------------------------------------- * (GreyEnter) Center line after typing, from Kyle Watkins, Semware * ---------------------------------------------------------------------- * * You can use the Centerline command, to center the current line * (based on your right margin setting) -- or use line blocking to mark a * range of lines -- then issue the Centerline command to center the * individual lines of the marked line block. * If you have an enhanced keyboard, and you have QEdit using the * enhanced keyboard, you may want to try the following macro: greyenter macrobegin centerline endline return * * 7 bytes Sat 08-25-1990 17:32:31 (size added by TH) * Now when you type your text, then press the Grey Enter Key (Far right * hand side of your keyboard), your text will be centered as the cursor * moves to the next line. * This will keep your regular Enter key, to be used as normal -- * Please note that if you DO NOT have an enhanced (101 key) keyboard, with * QEdit recognizing it as such -- then the Grey Enter and regular Enter, * are treated as the same key. * Hope that helps. * --... ...-- * .......Kyle Watkins (SemWare Technical Support)