* RFR004.QM * Written By Tom Hogshead * [ See RFRMxx.QM For Use ] * August 2, 1991 * Key Subfile Description * ===== =============== ==================================================== * @(F6) Right Justifies BLOCK (Line Or Character Blocks) * @(F1) Right Justifies DOCUMENT * @(F2) Right Justifies DOCUMENT, Screen Preview * @(F4) Removes Right Justification From LINE Or BLOCK * @(F5) Removes Right Justification From DOCUMENT * #(f7_) Left Justify Column Block, Right Ragged (RB) * #(f8_) Right Justify Column Block, Left Ragged (RB) * (RB) = Richard Blackburn Author * * {e:\up\RFRM*}--Return To RFRMxx.QM * *-- eoi *  *旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� *� @(F1) Right Justify to file with same prefix, ".rj" extension � *읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * Macros @F1 and @F2 use the right justification program RJ.COM which is * included and must be located in current directory or path. See below * for documentation of RJ.COM. * @F1 macrobegin Unmarkblock Begfile Insertline * Insert temp line with Dropanchor Currentfilename * CurrentFileName marked Find "." Return "B" Return * Find dot backwards Deltoeol ".rj" * THEN add ".rj" after dot Cut Savefile * Cut name.rj to scrap/SaveFILE DOS "RJ " Currentfilename * Right justify file ">" Paste Return Return * Editfile Paste Return Quit * Editfile Return * Load justified file FIRSTWORD: * FIRSTWORD loop removes right * justification from last line * of paragraph, often neater! EndPara Begline * Get to end of paragraph Shiftright Wordright * Put cursor on start of first Shiftleft Cursorleft * word on line Markcolumn Endline Markcolumn * Marks from first word to eol *----Remove Right Justification From Last Line in Paragraph-------* Begline FindReplace " " Return " " Return "LN" Return Begline FindReplace " " Return Return "LN" Return Begline * FindReplace " " Return Return "LN" Return * Unmarkblock NextPara * Get to begin next paragraph jtrue FIRSTWORD: * More para? Loop again FINISH: *ELSE Begfile * Go tof * * 106 bytes Wed 02-20-1991 16:28:30 * ......................Documentation for RJ.COM................... * * USAGE: RJ { PRINT_MARGIN F S } * * WHERE: 0=< PRINT_MARGIN =<40 Default = 0 enter like: 8 * F FILTERS control chars Default = OFF enter like: F * S SUPPRESS Line Feeds after CR Default = OFF enter like: S * * PURPOSE: RJ Right Justifies your printer output, making it look * professional. RJ right justifies text files by imbedding blanks * between words. It is compatible with VDE or any other ASCII text * editor. Public domain. * * METHOD: RJ imbeds spaces between words. It calculates the longest * line in the file (40 to 255 char), then justifies shorter lines (up * to 15% shorter ). Non-printable control characters are not counted * for formatting purposes, so leave them in if you wish. Carriage * Returns, Line Feeds, Form Feeds, and Tabs are always processed * normally and printed. Indenting at the beginning of the line is * disregarded, but any line with 3+ IMBEDDED spaces, or any line with * Tabs is not justified. This leaves tables, charts, etc. intact. * * HINTS: All parameters except INFILE are optional and they may be * entered in any order; the defaults are above. Note that the input file * is left unaltered; output defaults to the screen. This allows you to * preview your printer output. To print or copy your right justified * file, use the DOS redirection operator: RJ REPORT.TXT F 6 > PRN. Save * your normal parameters in a batch file. *  *旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커 *� @(F2) Right Justify, screen preview � *읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸 * Macros @F1 and @F2 use the right justification program RJ.COM which is * included and must be located in current directory or path. See above * for documentation of RJ.COM. * @f2 Macrobegin Savefile DOS "RJ " Currentfilename Return * * 14 bytes Sun 12-02-1990 01:02:50 *  *旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� *�@(F4) Removes Right Justification from line or block � *읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * Position cursor on first line to be un-justified, press @F4, then * cursor down to last line to be un-justified, and press . * If cursor is between paragraphs, cursor is automatically placed on the * first word of the next paragraph. * @F4 Macrobegin Unmarkblock START: Endline Begline * Test if line not blank Jtrue FIRSTWORD: * If not blank, goto FIRSTWORD Wordright * If blank, goto first word Jump START: * and check for blank line again FIRSTWORD: * Shiftright Wordright * Put cursor on start of first Shiftleft Cursorleft * word on line, Gotocolumn "80" Return * Get all line in block * Markcolumn Prevposition * Mark column at first word Begline * Reposition cursor Jfalse NEXT: * If first word in col. 1, * test is false, go to NEXT Prevposition * Otherwise, back to first word NEXT: Pause * Pause to cursor to last line Markcolumn * Mark end of block Gotoblockbeg * Get to block begin FindReplace " " Return " " Return "LN" Return FindReplace " " Return Return "LN" Return * FindReplace " " Return Return "LN" Return * Unmarkblock * Nextpara * Makectrofscreen * * * 81 bytes Wed 02-20-1991 12:48:50 *  *旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� *� @(F5) Removes Right Justification from DOCUMENT � *읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * @F5 Macrobegin Begfile Unmarkblock * START: * Endline Begline * Test if line not blank Jtrue FIRSTWORD: * If so, goto FIRSTWORD Wordright * If not, move to first word Jump START: * and check for blank line again FIRSTWORD: * FIRSTWORD loop removes right * justification from paragraph Begline Shiftright Wordright * Put cursor on start of first Shiftleft Cursorleft * word on line, Markcolumn Endpara * and start column mark Gotocolumn "80" Return * Be sure to get all para * in block Markcolumn * Mark para as block Gotoblockbeg * Start @ block begin FindReplace " " Return " " Return "LN" Return * FindReplace " " Return Return "LN" Return * FindReplace " " Return Return "LN" Return * Unmarkblock * NextPara * Get to begin next para Jtrue FIRSTWORD: * More para? Loop again FINISH: * No more paragraphs Begfile * * 80 bytes Wed 02-20-1991 12:46:32 *  *---------------------------- * @(F6) Right Justifies BLOCK *---------------------------- * * Mark block to right justify and press @F6. Block must be a line or * character block, NOT a column block. * * Remember, block to be right justified must * be at least 2 lines. Right justification * RJ.COM calculates the longest line in the * block (40 to 255 char), then justifies * shorter lines (up to 15% shorter) by * imbedding spaces between words. This block * was right justified with @F6 WITHOUT * asterisks. * @F6 Macrobegin *---Copy Block To Temp File-------------* Editfile "c:!" Return * Load temp file c:! Killfile Quit * Kill/quit it Gotoblockbeg * Position cursor to come back Jfalse STOP: * Stop macro if no block Onewindow * Close all windows Horizontalwindow Zoomwindow * Open window Editfile Return * Load blank temp file c:! Copyblock * Copy block to c:! *---Cut "c:!.rj" To Scrap---------------* Unmarkblock Begfile * Unmark block & go to bof c:! Insertline Currentfilename * Insert CurrentFileName "c:!" ".rj" * Add ".rj" extension Cut * Cut "c:!.rj" to scrap *>>> QCONFIG.DAT must be configured to cut unmarked lines to scrap: <<< *>>> Should Cut and Copy use current line if no block marked (Y/N)? [Y] Savefile * Save c:! to right justify it *---Right Justify Temp File-------------* DOS "RJ " Currentfilename * Right justify c:! temp file ">" Paste Return Return * to c:!.rj Editfile Paste Return Quit * Quit c:!.rj if loaded Horizontalwindow Zoomwindow * Open window Editfile Return * Load justified file c:!.rj *---Mark Right Justified Block----------* Markcolumn * Begin marking at tof Endfile * Go to eof Gotocolumn "80" Return * Get all text in block Cursorup Markcolumn * Move up off blank line, mark *---Copy Right Justified Block Back-----* Nextwindow * Return to orig file Copyoverblock * Copy right justified block * back to where we were *---Clean Up Temp Files, View RJ Block--* Nextwindow Killfile Quit * Kill/quit c:!.rj and return * to where we started Editfile "c:!" Return * Load c:! to kill/quit Killfile Quit * and do it! Gotoblockbeg * Go back to where we started & * unmark/save file if OK! STOP: * We're done..... * * 83 bytes Mon 02-25-1991 06:51:47 *  * ------------------------------------------- * #(f7_) Left Justify Column Block, Right Ragged * ------------------------------------------- * #f7 MacroBegin * EditFile "nul" Return Quit * Quit nul file if loaded GotoBlockBeg * Position cursor for paste back EditFile Return * Load empty nul file "a" Return * Insert "a" in column to align * text below left justified CopyBlock * Copy block to justify to nul Label0: * Align * Justify line left JTrue Label0: * and do until no more to do Cut * Then cut block to scrap Quit * Quit nul file PasteOver * And paste it where we were UnmarkBlock * Unmark left justified block * * 28 bytes Mon 03-18-1991 21:51:51 *  * ------------------------------------------- * #(f8_) Right Justify Column Block, Left Ragged * ------------------------------------------- * #f8 MacroBegin * EditFile "nul" Return Quit * Quit nul file if loaded GotoBlockBeg * Position cursor for paste back EditFile Return * Load empty nul file CopyBlock * Copy block to justify to nul GotoBlockEnd * Position cursor at block end UnmarkBlock * Unmark Label1: * MarkColumn EndLine MarkColumn * Mark blank space at eol Cut * Cut it to scrap BegLine * Move to bol Paste * Paste blank space at bol EndLine * JTrue Label0: * Line has text, go mark eol GotoBlockEnd *ELSE line has no text, * nothing to justify, and * goto block end to dot label Label0: * "." * Label eol with dot in case * last line in block is blank CursorLeft CursorLeft * Move left off dot UnmarkBlock * Unmark CursorUp * Move up to next line JTrue Label1: * And right justify until done BegLine *ELSE all lines right justified CursorRight * Move off blank space MarkColumn EndFile * Begin marking, goto eof CursorLeft CursorLeft * Move left off dot MarkColumn * Mark right justified block Copy * And copy it to scrap Quit * Quit nul file PasteOver * And paste it where we were UnmarkBlock * Unmark left justified block * * 50 bytes Mon 03-18-1991 21:52:05