* 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * 袴袴� Macros to Reformat Blocks, Paragraphs and Documents, v1.5 팠袴� * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * REFORM15.QM * * REFORM15.ZIP are macros to reformat QEDIT blocks, paragraphs, and * documents. Asterisks are also added and deleted in front of lines, * blocks, and paragraphs for commenting. * * Added Alt_t and Alt_2, shortened Alt_1 to 32 bytes, and changed key * assignments in v1.5. * * KEY DESCRIPTION * Old New * @1 Adds asterisk and space in front of marked block. * @t Adds asterisk and space in front of marked block.(T Farley) * @2 Deletes asterisk and space in front of marked block. * @2 @3 Adds asterisk and space in front of marked PARAGRAPH block * @6 Adds asterisk and one space in column 1 * @4 Deletes asterisk and one space in column 1 * @7 Deletes asterisk and ALL space at beginning of line * @3 ^3 Formats a paragraph. (Macro has been around a long time) * @5 ^5 Formats document with blank lines forming paragraphs * @8 ^8 Formats QMAC txtfile block with asterisk in column 1 * @9 ^9 Formats Block. Must position cursor at beginning of block. * @0 ^0 Formats Paragraph Only. Keeps in original indented position. * * * If column width of the unformatted paragraphs and blocks are greater * than 80 columns, there must be enough blank lines for ^8, 9 & 0 to * paste the reformatted text back and not overlap unformatted areas. In * otherwords, BE CAREFUL! * * NOTE: It is suggested that Ctl_0 be used for "TECHNIQUE- ONLY". The * same thing is better accomplished by Alt_3. Be sure AutoIndent is set * ON. * * For faster macro execution, replace "C:" with your ram drive. * * * * VERSION HISTORY: * * 1.1 - added Alt_6,7 & 8 to format QMAC txtfiles * 1.1a- modified Alt_8,9 & 10 to get off screen-text in block * 1.2 - added Alt_5 to format entire document QUICKLY keeping * indented paragraph positions in place * Alt_4 to format entire document keeping indented * paragraph positions in place * Alt_3 to format paragraph only * - modified other macros to handle line widths to 512 * 1.2a- modified this documentation * 1.2b- Added @2 to make single column txtfile from * QMAC txtfile, v1.2b * 1.2c- changed 160 in @9 to 512 * 1.2d- @2 removed, now in COLUMN10.ZIP * - @4 removed * - added killfile @0 * - changed macro comments * 1.3 - added Alt_1 & 2 to put asterisk and space in front * of blocks and paragraphs * 1.4 - added Alt_4 to remove asterisk and space in column 1 * 1.5 - added Alt_t (from Tim Farley) to do the same as Alt_1 * - changed key assignements * - added Alt_2 to remove asterisks in front of blocks * - shortened Alt_1 to 32 bytes * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �@1 Place asterisk and space in column 1 in front of marked block � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * * To run, first mark a block with markblockbegin and markblockend. The * cursor may then be positioned anywhere to run. After loading the * macro, press Alt and 1 at the same time. An asterisk and a space are * placed in column 1 in front of the marked block only. Marked block * does NOT have to be a paragraph as in Alt_2. If a block is not marked * the cursor line is treated as a block, and an asterisk and space are * placed in column 1 the same as done with Alt_6. * @1 macrobegin cut * Get block to scrap editfile "$" return * load $ (temp file) quit * quit if in ring editfile return * reload paste * paste block to $ begfile * get to top of $ NEXT: * come here until done endline begline * check if line blank jfalse GETBACK: * if line blank, go to GETBACK "* " * put asterisk space in col 1 cursordown * move down to next line jump NEXT: * if not done go to NEXT GETBACK: * come here when done adding * begfile * go to begfile $ markblockbegin * get line 1 col 1 in block copy * get block w/asterisks to scrap quit * quit $ paste * Put block back with asterisks * makectrofscreen * better view END: * * 37 bytes Mon 08-20-1990 21:02:06 * 32 bytes Wed 08-22-1990 00:00:48 removed last line and C: * Here's an alternate version of Alt_1 from Tim Farley of SemWare that * seems to do the same thing. It's faster, runs smoother, but is a * little larger if that's important. I feel Tim came up with a better * way to do the same thing by using shiftright and fillblock. Use * whichever you prefer that get's the job done for you. * * ============================================================================== * Date: 08-21-90 (19:02) Number: 9587 Semware - Qedit Suppor * To: PETER NGUYEN Refer#: 9583 * From: TIM FARLEY Read: YES * Subj: COMMENTING MACRO Conf: (0) Main Board * ------------------------------------------------------------------------ * PN>I tried out two dBase commenting macros (from Tom Hogshead) last night. * PN>Neither of them does quite what I'm trying to achieve. * PN> * PN>What I need to do is comment out (i.e., put an asterisk in front of) * PN>each line in a blocked area. * * Here's an alternate version that uses the column marking ability, * ShiftRight, and FillBlock to do the job. * * DBASE COMMENT OUT MACRO * * Mark a block (doesn't matter if it is a char, line or column block). * Hit this key, and all the lines in the block will be commented out * with a "* " at the beginning of the line. * * After it is done, the block will be left marked as a line block, * and the cursor will be at the top of the block. * * Correctly detects case where you are in the middle of marking, * and also the case where no block is marked. * @t MacroBegin GotoBlockBeg * Has block been closed? GotoBlockEnd JTrue doit: * if cursor moved, go ahead MarkLine * no movement? close block GotoBlockEnd JFalse end: * no movement? no block! quit. doit: GotoBlockEnd * Remember end of the block GotoBlockBeg * But go to beginning MarkLine * Mark as line from here... PrevPosition * ...to the previous end of block. MarkLine ShiftRight ShiftRight * Two characters over please GotoBlockEnd * Remember end of the block GotoBlockBeg * But go to beginning MarkColumn * Start marking a column PrevPosition * ...to end of previous block BegLine * But only in column 1 of these lines MarkColumn * ...and finish marking. FillBlock "*" Return * Fill Column 1 with Stars! GotoBlockEnd * Remember end of the block GotoBlockBeg * But go to beginning MarkLine PrevPosition MarkLine * Re-mark as a line block GotoBlockBeg * And leave us at the top. Jump done: end: UnMarkBlock done: * * 41 bytes Tue 08-21-1990 23:46:45 (line added by TH) * Interestingly enough, since "*" is also a comment mark for QEdit * macros, you can use this to comment out lines in QEdit macros * too! * * There is one special case where this macro can do something odd, * and that is if you mark a single line as a block and comment it * out. But since a single line can be commented out just by * hitting HOME and typing "*", I doubt that will be a problem. * * One nice side effect: it leaves the lines marked as lines, so if * you want to *uncomment* them, just hit ShiftLeft twice. * * If you remove the comments and reformat, I think you can fit this * in QCONFIG.DAT. * * --Tim Farley * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커 * � @2 Deletes asterisk and space in front of marked block. � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸 @2 macrobegin gotoblockbeg * block? JFalse END: * no block! end shiftleft shiftleft * delete asterisk and space unmarkblock * unmarkblock END: * * 11 bytes Wed 08-22-1990 10:29:17 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �@3 Places an asterisk and space in front of block that IS a paragraph� * � and also in front of any paragraph that is NOT marked as a block � * � from the cursor to the end of the paragraph. � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * * To run, first either mark a paragraph as a block with markblockbegin * and markblockend or position the cursor at the beginning of a * paragraph in column 1. After loading the macro, press Alt and 2 at * the same time. An asterisk and a space are placed in column 1 in * front of the block or the paragraph from the cursor to the end * of the paragraph. Remember a paragraph is defined as having a * blank line at the beginning and end. * @3 macrobegin gotoblockbeg * go to block begin NEXT: * endline begline * end if line blank jfalse END: * if line blank, go to end "* " * put asterisk space in col 1 cursordown * move down to next line jump NEXT: * cycle until done END: * * * 18 bytes Mon 08-20-1990 22:19:35 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �@4 Deletes asterisk and SINGLE space at beginning of line� * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * Use to remove asterisk and space inserted with Alt_6. Lines with * no asterisk are not changed. * @4 macrobegin START: unmarkblock * unmark any blocks begline * go to begline markcolumn * mark it cursorright * go to column 2 find "*" return * find asterisk space "BL" return * back in block only jfalse NEXT: * if found delch * delete asterisk delch * delete space NEXT: * come here if no astk in col 1 cursordown * down to next line begline * begline unmarkblock * unmark * * 25 bytes Tue 08-21-1990 13:30:16 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커 * �@6 Adds asterisk and one space at beginning of line � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸 * Useful in preparing txtfiles for QMAC. To run, just press Alt_6 and an * asterisk and blank space are inserted in column 1 and 2 in front of * any other text on the line. Use Alt_4 to remove asterisk and space * inserted with this macro. * @6 macrobegin unmarkblock begline "* " cursordown begline * * 12 bytes Mon 07-30-1990 11:03:14 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �@7 Deletes asterisk and any space at beginning of line � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * To run, press Alt_7, and the asterisk in column 1 on the cursorline * and all space up to the first word on the line is deleted. This * macros erase too much if there are two asterisks and no letters on * same line. * @7 macrobegin unmarkblock * get ready begline * go to begline delch * delete first asterisk endline begline * check if anything else on line jfalse NEXT: * if line blank, go to next markcolumn * otherwise, mark begline wordright * go to first word on line cursorleft * get cursor off word deleteblock * delete all space to beginline NEXT: * cursordown * cursordown and end * * 17 bytes Mon 07-30-1990 11:03:26 * * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �^3 Formats a paragraph. (Macro has been around a long time) � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * 04 macrobegin cursordown * move down one line prevpara * get to beginning of paragraph wrappara * reformat nextpara * go to begin next paragraph * * 8 bytes Wed 08-01-1990 10:47:36 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �^5 Formats complete document with blank lines forming paragraphs � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * 06 MacroBegin unmarkblock * unmark begfile * get to file begin setrmargin "70" return * set new right margin FORMAT: * jfalse FINISH: * no more para? go to FINISH WrapPara * reformat NextPara * get to begin next paragraph jump FORMAT: * FINISH: * no more paragraphs setrmargin "80" return * reset right margin * * 26 bytes Wed 08-01-1990 10:47:50 * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �^8 Formats QMAC txtfile block with asterisk in column 1 � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * To run, position the 'cursor line' on the first line of the block to * reformat. Press Ctl_9, then cursor down to bottom of block to * reformat. To reformat, press 'Enter' when the block is marked. This * macro differs from Ctl_9 in that the block does not include the * asterisk and blank space; in Ctl_9 the block starting postition is * selected by the starting position of the cursor line. This macro also * differs from Alt_0 which formats a paragraph from first blank line * which has no text or asterisk on line to last blank line. * * 09 macrobegin unmarkblock * get ready gotocolumn "512" return * get all block to format markcolumn * mark begin of block begline * start at line begin wordright * get to first word on line cursordown * position to cursor down makectrofscreen * see better pause * cursor to end, then 'Enter' markcolumn * mark end of block gotoblockbeg * Get to block begin JFalse END: * No block? End cut * Get into scrap editfile "C:$" return * load C:$ (temp file) quit * quit if in ring editfile return * reload paste * paste block to C:$ setrmargin "69" return ** * set rt margin to 69 ** change "69" as needed wrappara * format block setrmargin "80" return * reset rt margin to 80 begfile * get to block begin markcolumn * mark endfile * mark endblock gotocolumn "69" return ** * get all block marked ** change "65" as needed copy * get formatted block to scrap quit * quit C:$ pasteover * Put back formatted, marked makectrofscreen * better view END: * * 67 bytes Mon 07-30-1990 11:03:37 * 69 bytes Wed 07-30-1980 21:25:50 extra width in line 3 * 63 bytes Wed 08-01-1990 10:15:09 shrunk * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �^9 Formats Block. Must position cursor at beginning of block � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * To run, position the 'cursor' at the beginning of the block * to reformat. Press Ctl_9, then cursor down to bottom of * block to reformat. Press 'Enter' when the block is marked. * This macro differs from Ctl_8 in that the starting position * of the block to be reformatted is selected by the starting * position of the cursor; in Ctl_8 the block starting * postition is selected by the starting position of the cursor * line. 10 macrobegin unmarkblock * get ready gotocolumn "512" return * get all block to format markcolumn * mark begin of block prevposition * begline * prevposition * makectrofscreen * see better cursordown * position to cursor down pause * cursor to end, then 'Enter' markcolumn * mark end of block gotoblockbeg * Get to block begin JFalse END: * No block? End cut * Get into scrap editfile "C:$" return * load C:$ (temp file) quit * quit if in ring editfile return * reload paste * paste block to C:$ setrmargin "60" return ** * set rt margin to 60 ** change "60" as needed wrappara * format block setrmargin "80" return * reset rt margin to 80 begfile * get to block begin markcolumn * mark endfile * mark endblock gotocolumn "60" return ** * get all block marked ** change "60" as needed copy * get formatted block to scrap quit * quit C:$ pasteover * Put back formatted, marked makectrofscreen * better view END: * * 65 bytes Mon 07-30-1990 11:03:49 * 70 bytes Wed 07-30-1980 21:40:52 extra width in line 3 * 64 bytes Wed 08-01-1990 10:15:29 removed extra C:$ * This is a test block. To format, place the "cursor" on "t" in * in "this" on line 1. Then press Ctl_9 and cursor down to * block end. When the block has been marked press * 'Enter'. * Asterisks need not be removed. * 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * �^0 Formats Paragraph Only. Keeps in original indented position. � * 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴� * To run, place cursor line anywhere in a paragragh, and press Ctl_0. * This macro yields the same formatted paragraph as does Alt_t if the * right margin is set to 60 in the QEdit menu or in QCONFIG.DAT except * that the paragraph beginning is moved to column 1. This macro is the * starting point for putting together macros Ctl_8 and 9. If there are * asterisks in column 1 they are also formatted as part of the * paragraph. * 11 macrobegin unmarkblock * get ready cursordown * get into paragraph prevpara * get to paragraph begin markcolumn * mark column endpara * get to paragraph end gotocolumn "512" return * get all paragraph in block markcolumn * mark paragraph gotoblockbeg * Get to paragraph begin JFalse END: * No block? End cut * Get into scrap editfile "C:$" return * load C:$ (temp file) quit * quit if in ring editfile return * load new paste * paste block to C:$ setrmargin "60" return ** * set rt margin to 60 ** change "60" as needed wrappara * format block setrmargin "80" return * set rt margin to 80 begfile * get to block begin markcolumn * mark endfile * mark end block gotocolumn "60" return ** * get all block marked ** change "60" as needed copy * get formatted block to scrap killfile * killfile quit * quit C:$ pasteover * Put back formatted, marked makectrofscreen * better view END: * * 61 bytes Wed 08-01-1990 10:15:38 removed extra C:$ * 62 bytes Sat 08-04-1990 15:32:43 added killfile *****************************TEST PARAGRAPH*********************************** This is a test paragraph. First, ADD asterisks in column 1 if you intend to convert this txtfile to a macfile with QMAC. After converting to a QMAC macfile and before reformatting this paragraph **************REMOVE-THE-ASTERISKS***************. Place the cursor line anywhere in this paragraph, press Alt_4/5/0. Be sure AutoIndent is ON. ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** ***************************************** long line for test ========================================>> ******************************TEST PARAGRAPH*********************************** *..Tom Hogshead Tue 08-21-1990 00:11:00