* BOOK19.QM * Macros To Jump To BookMarks And Read Macros * Written by Tom Hogshead * 8/26/91 * Key Subfile Description * ===== ========= ===================================================== * @(f) {e:\up\bok001} * --Jump From Index Line To Macro or Item Located Either |chg * In Document Below Or In A Designated Subfile * @(6) {e:\up\bok001} * --Select Txtfile To Load And Read Macros From Index * @(7) {e:\up\bok001} * --Select And Read Macros From Index, |chg * Txtfile Not Loaded * @(8) {e:\up\bok001} |chg * --Read Macros of Subfile on Cursor Line, * Txtfile Not Loaded * @(0) {e:\up\bok001} * --Save Current Macro Buffer And * Read Previously Saved Macro Buffer * @(eq) {e:\up\bok001} @= * --Read Current Txtfile Macros * @(mi) {e:\up\bok001} @- * --Read Previously Saved Macro Buffer * ^(f1) {e:\up\bok001} * --Cycle Between Starting and Selected Files * After Invoking @6 *-- * @(4) --Jump From Index Line To First Word Enclosed * With ( ) In the Document Below * (Quicker Version of @1 That Positions * Cursor On First Index Selection Line) * @(1) --Jump From Index Line To First Word Enclosed * With ( ) In the Document Below * @(2) --Finds First Word On Cursor Line In Document Below, * "Marked" Or "Unmarked", And Encloses Selected * Found Word In Document With ( ) * @(3) --Copies Word At Cursor In Document To Index * Enclosing Word At Cursor And Word In Index With ( ) * (F4) --Continues Searching Until the Desired Word * Is Found In Document Below Using @2 *-- * {e:\up\INDX*}--Index of Macros In AMACxx.ZIP * * Misc * ------ * (Description) - BookMarker Macros * (Configuration) - MUST do * (Using) Macros - Start up and Macro Execution * (Macros) - BookMarker Macros * (Other) Macros - not included * (Version) history * *-- eoi * (Description) * -------------- * BOOK19.QM are a series of macros enabling the user to load, * read, and/or invoke macros located in any file. Files, items * or macros may be quickly located in any file by enclosing a key * identification word in parentheses and placing the bookmarked * word in an Index. This version includes macros using the new * and *not- recommended* technique of a "macro reading a macro". * A theoretically unlimited number of macros (in excess of the * limited 0.5k QConfig.dat buffer) located in files other than * the current file can be quickly located and easily executed at * any time using either @f, @6, @7 or @8 while editing any file. * (See bok001.qm for additional discussion). * For anyone using more than a few macros and who might be tight * on QConfig macro buffer space, the macros in bok001.qm may be * of interest; they are allowing me to have immediate access while * editing any file, to quickly load and run over 300 macros in * about 50 files compiled to more than 20,000 macro bytes -- and * with 150 bytes QConfig macro buffer space to spare. I am still * testing and improving these macros, and so far I'm encouraged. * Beware, these macros are not for the feint of heart ! * The techniques, necessary configuring, and use of these * bookmark macros require a considerable knowlege of QMAC and * QEdit macro language. The new techniques they involve have not * been fully tested. These are my first real effort to have a * macro read a macro, a heretofore (and still) not recommended * procedure. Until this "macro reading a macro" technique can be * fully tested and proven to be viable, I do *not* advise the * user use this technique in other macros without full knowledge * of it's pitfalls and limitations. * (Configuration) - MUST do * --------------------------- * In order to access files and/or invoke macros in different * directories, all files listed in 'e-up.lst' MUST be configured * for the user directory containing AMAC files. My directory, * e:\up, occurs over 100 times and must be changed using the * following configuration procedure which takes a few minutes * to do the search/replace and compile using QMAC: * 1. Make a two letter directory on your hard drive named \UP. * If this conflicts, then any two letter directory will * suffice. * 2. First expand all files in AMACxx.ZIP to \UP directory. * 3. Change to \UP directory. * 4. Replace 'e:\up\' with [ dir:\ ] in all files in the file * list 'e-up.lst' using SRQ.BAT search/replace batch file from * SRCHxx.QM: * SRQ.BAT e:\up\ [ dir:\ ] @e-up.lst * e.g. if c:\up is your directory containing AMAC files: * SRQ.BAT e:\up\ c:\up\ @e-up.lst * ^^^^^^ * BOOKxx v 1.8 used SR.BAT. The total size of files in * e-up.lst is almost 400k and greater than the QEdit can * handle, so we must either use SRQ.BAT as shown here, or * repeat the search/replace using SR.BAT until all * replacements have been made. * 5. After the search/replace is complete, exit QEdit and convert * changed txtfiles to macfiles using QMAC with the following: * E-UP.BAT * 6. Put the following bok001.qm macro in QCONFIG.DAT, changing * dir:\ to your directory containing AMAC files: * @f macro_begin macroread "[ dir:\ ]bok001.mac" return * e.g., * @f macro_begin macroread "c:\up\bok001.mac" return * ^^^^^^ * 7. The following macros in bok001.qm should also be installed * in QConfig.dat and then commented out of bok001.qm after * installation. They will then be available in any editing * session as long as no subsequently installed macros have the * same keys. * ^f1 Cycle Between Starting and Selected Files After Invoking @6 * @0 Save Current Macro Buffer, Read Previously Saved Macro Buffer * @= Read Current Txtfile Macros * @- Read Previously Saved Macro Buffer * 8. After completion of steps 4 and 5 above, changing c:\ to a * ram drive in all macros in bok001.qm will increase macro * execution speed, although this in not necessary. * (Using) Macros * --------------- * The following examples demonstrate the use of macros in * bok001.qm using @6 and @f. * To execute bok001.qm macros, be sure Insert is ON and then: * 1. Load BOOK19.QM into a QEdit window. * 2. Read the macfile bok001.mac as follows: * @f * Macros @f and all other macros in bok001.qm are now loaded. * 3. Run @6. Cursor down to desired txtfile in INDXxx.QM to load * the selected txtfile, and press . At the next pause, * cursor down to desired macro to load it's txtfile and read * it's macros. Selecting @f will load subfile bok001.qm and * read it's macros, with the cursor positioned on a * description of @f. * 4. Press ^f1 to cycle between BOOK19.QM and bok001.qm * 5. Press @6 again to select, load and read another set of * macros. * These macros require "QEdit and QMAC v2.1, February, 1990" or later. * (Other) Macros: See ALLMACRO.INF for other macros. See also * JMPPOSxx.QM for macros to jump to positions within * and across files using position markers. * (Macros) * --------- *  * ------------------------------------------------------------------------- * @(1) Jump To First Word On Cursor Line "Marked" In The Document Below * ------------------------------------------------------------------------- * * @1 macro has 2 steps: * * 1. Press Alt and 1 at the same time. Line 1 is marked to * highlight. Cursor down to desired line in Index. * * 2. Press Enter. The macro then jumps to the first word * cursor line in the document below. * @1 differs from @f in that @1 will only find an Index item or * macro in the current file. @f will find them in an unlimited * number of files. @1 macrobegin unmarkblock * Unmark any marked blocks defaultwordset * In case altwordset on begfile markline markline * And highlight line 1 pause * Pause for Index selection wordright markword * Mark first word on line copy * Copy word to scrap endpara * Go to end of Index find "(" paste ")" * return "I" return * Find first marked word in doc jfalse NOMARK: * begline * If mark found go to begline maketopofscreen scrollup * Cursor on line 2 |a jump END: * NOMARK: * begfile * If no mark found go to begfile END: * * 32 bytes Tue 09-11-1990 11:19:51 * 33 bytes Wed 06-26-1991 11:23:27 (TH @1, added defaultwordset) * 33 bytes Fri 07-05-1991 10:31:13 (TH @1, moved makectrofscreen down) * 33 bytes Wed 07-10-1991 10:11:24 (TH @1, moved makectrofscreen back up) * 34 bytes Sun 07-28-1991 15:48:33 (TH @1, changed found cursor pos |a) * Here a QMAC compiled version of @1 that will fit on a single line in * QConfig.dat: * @1 MacroBegin UnmarkBlock DefaultWordSet BegFile MarkLine * MarkLine Pause WordRight MarkWord Copy EndPara Find "(" Paste * ")" Return "I" Return JFalse Label0: BegLine MakeTopOfScreen * ScrollUp Jump Label1: Label0: BegFile Label1: * 34 bytes Sun 07-28-1991 15:48:33 (TH @1, changed found cursor pos |a) * This above version of @1 is 34 bytes. You may want to use the * following shorter version (22 bytes) where searching starts from * cursor line, not at the end of the first paragraph of the (Index), as * above: * @1 macrobegin * unmarkblock * unmark any marked blocks * defaultwordset * in case altwordset on * begfile * go to file begin endline * markline * highlight to show 'on' * markline * * pause * pause for Index selection * wordright markword * mark first word on line * copy * copy word to scrap * find "(" paste ")" return * find first marked word in doc * return * begline * if mark found go to begline * * 21 bytes Tue 09-11-1990 11:22:45 added markline * 22 bytes Wed 06-26-1991 11:23:27 (TH @1, added defaultwordset) *  * ------------------------------------------------------------------------- * @(4) Jump To First Word On Cursor Line "Marked" In The Document Below * Positions Cursor On First Index Selection Line For Quicker Selection * ------------------------------------------------------------------------- * This macro is an alternate version of @1 that positions the cursor on * the first Index selection line instead of the top line as @1 does. * This enables the user to more quickly make a selection to jump to. @4 macrobegin unmarkblock * Unmark any marked blocks defaultwordset * In case altwordset on begfile * endpara * Move to end of Index markline * Mark it begfile * Move to bof find "(" return "L" return * Locate first Index selection line jfalse NOMARK: * makectrofscreen * Show top of file begfile * Move back to bof unmarkblock markline markline * And highlight line 1 prevposition * Move back to first selection line begline * Cursor in col 1 pause * Pause for Index selection wordright markword * Mark first word on line copy * Copy word to scrap endpara * Go to end of Index find "(" paste ")" * return "I" return * Find first marked word in doc jfalse NOMARK: * begline * If mark found go to begline maketopofscreen scrollup * Cursor on line 2 jump END: * NOMARK: * begfile * If no mark found go to begfile END: * * 34 bytes Sun 07-28-1991 15:48:33 (TH @1) * 52 bytes Wed 07-31-1991 14:43:31 (TH @4 in BOOKxx.QM) * Here's a QMAC compiled version of @4 that will fit on a single line in * QConfig.dat: * @4 MacroBegin UnmarkBlock DefaultWordSet BegFile EndPara * MarkLine BegFile Find "(" Return "L" Return JFalse Label0: * MakeCtrOfScreen BegFile UnmarkBlock MarkLine MarkLine * PrevPosition BegLine Pause WordRight MarkWord Copy EndPara * Find "(" Paste ")" Return "I" Return JFalse Label1: BegLine * MakeTopOfScreen ScrollUp Jump Label2: Label0: Label1: BegFile * Label2: * 52 bytes Wed 07-31-1991 14:43:31 (TH @4) *  * ---------------------------------------------------------------------- * @(2) Finds Word In Document, Adds () To Found Word And Returns To Index * ---------------------------------------------------------------------- * * @2 macro has 3 steps: * * 1. Press Alt and 2 at the same time. The macro finds first word * on the cursor line in the document below. If first found word * is not the desired occurrence, press F4 for next word or until * the desired occurrence is found. * * 2. When the desired word and location are found, press Enter. * The macro places () around desired found word and then return * to the original word in the Index. * * 3. Press Enter again and the macro places () around the original * word in the Index. The cursor ends at end of the marked word in * the Index so comments may be added. Be careful not to mark the * same word more than once or only the first occurrence of the word * in the document will be found with @1 and @f. * @2 macrobegin * defaultwordset * in case altwordset on wordright markword * mark first word on line copy * copy word to scrap find paste return "I" return * find first word in doc |a pause * pause for Enter or F4 "(" * place ( in front of word markword * markword gotoblockend ")" * place ) at end of word pause * pause for Enter if OK begfile * go to file begin find return delline return * find selected word doc |a pause * pause for Enter if OK markword * markword gotoblockbeg "(" * place ( in front of word gotoblockend ") " * place ) at end of word unmarkblock * unmark word * * 35 bytes Sat 07-28-1990 15:17:55 * 36 bytes Wed 06-26-1991 12:13:45 (TH @2, added defaultwordset) * 38 bytes Sun 07-28-1991 16:24:04 (TH @2, changed Find's |a) *  * ---------------------------------------------------------------------- * @(3) Puts Word @ Cursor In Index With () Around Marked Word And In Index * ---------------------------------------------------------------------- * * @3 macro has 2 steps: * * 1. Press Alt and 3 at the same time. Macro marks the word at the * cursor in the document, then returns to the the end of the Index. * The marked word in the document is then copied at the end of the * Index with () around it. The cursor is at end of word so * comments may be added in the Index. * * 2. Press Enter and the cursor returns to the beginning of * the line of the marked word in the document. * @3 macrobegin * defaultwordset * in case altwordset on markword * mark word at cursor gotoblockbeg "(" * place () around word gotoblockend ")" * copy * copy word and ) to scrap begfile * go to file begin endpara * go to end of Index addline * add one extra line | begline "*" * insert star in col 1 at eoi | cursorright * make one space | "(" * insert "(" |a paste * paste word and ")" to eoi | endline * insert ")" in end of word | cursorright * make one space | unmarkblock makectrofscreen * unmark word and () | pause * pause for comments and if OK begline wordright markword * mark word copy * copy word to scrap find "(" paste ")" return return * return to word in doc begline * go to line begin * * 42 bytes Sat 07-28-1990 15:18:04 * 43 bytes Wed 06-26-1991 12:13:32 (TH @3, added defaultwordset) * 41 bytes Sun 07-28-1991 16:16:19 (TH @3, shortened |a) *  * ---------------------------------------------------------------------- * (f4) Continues Until Desired Word Is Found Using @2 * ---------------------------------------------------------------------- * * (see @2 for use) * f4 repeatfind * repeat find until desired word * & location are found * 5 bytes Sat 07-28-1990 15:18:17 (TH @4) * (QEdit) is not a marked Index word * (unmarked) is not a marked Index word * (be) is not a marked Index word * (window) is not a marked Index word * (Version) History * ------------------- * 1.0 - initial * 1.1 - changed document * 1.2 - modified @1 to keep normal cursor line color before selecting * an indexed word. Macro now does not find marked words in Index. * 1.3 - changed document BOOK13.QM * 1.3a- Changed other file names in series, this is an update. * 1.4 - Changed down arrow #25 to ! in @1. * - Changed .LST and .QL * 1.5 - Modified @1 to highlight line 1 rather than ! at end * 1.5a- Modified this file. * 1.5b- Modified this file and added START.BAT. * 1.6 - Modified @1, @2 and @3 to start with defaultwordset. * - Moved makectrofsccreen in @1 down. * 1.6a- Added @space to update @f in files. * - Added @f to load and read an unlimited number of macros. * - Included v1.6a in AMAC39.ZIP, July 21, 1991. * 1.7 - Changed @space to @5. @space key can only be used if * NewKey is loaded, July 23, 1991. * - Added @6 and @7 in bok001.qm to load and read macros from * an Index of all text files containing macros, July 25, 1991. * - Modified @1, @2 ans @3, July 28, 1991. * - @f was not reading subfile macros if key was not found. * Corrected and further modified, July 28, 1991. * - Included in AMAC39A.ZIP, July 29, 1991. * 1.8 - Added keys capability in INDXxx.QM. 7/30/91 * - Added @4, 'quicker' version of @1 IN BOOKxx.QM 7/31/91 * - Added @0, @= and @- to bok001.qm. 7/31/91 * - Added 'Save Current Macro Buffer' to @6, @7 & @f bok001.qm. 8/1/91 * - Added @8 to read only subfile macros at cursor line. 8/4/91 * (ver 1.8 in AMACxx.ZIP, v4.0) * 1.9 - Modified @7 and @8 in bok001.qm. 8/5/91 * - Changed configuration batch file to SRQ.BAT because total 8/9/91 * size of files in e-up.lst (approx 400k) exceeds QEdit limit. * SRQ quits each file after replacement, SR does not. * - Modified @f to handle odd cases. 8/22/91 * - Encyrpted @f. 8/26/91 * * * * * *