home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
editors
/
amac41.arj
/
COM003.QM
< prev
next >
Wrap
Text File
|
1991-08-26
|
22KB
|
455 lines
* COM003.QM
* Written By Tom Hogshead
* [ See COMTxx.QM For Use ]
* 8/8/91
* Key Description
* ===== ===============================================================
* @(8) Insert Text at Beginning of Blocked Lines (or Current
* Line If No Blocks Marked), John Goodman, Author
*
* #(F4__)-Surround Column-Blocked Text With Box Of Desired Characters,
* (John Goodman, Author)
* ********
* (Box Drawn Around Outside *Border* Of Column Block, Juxtapose Text)
* ********
*
* @(F4) -Erase Outside Border Of Column-Blocked Text And Collapse Text
* Surronding Block To Original Position Before Box Was Made,
* (John Goodman, Author)
*
* @(F8) --Put Colon In Front Of "Rem" Lines For Faster Batch File Operation
*
* ^(F7_)--Prepend Prompted Text To, Or Delete Prompted Text From,
* The Beginning Of The Current Or Blocked Line(s),
* (John Goodman, Author)
*
* #(F7__)-Prepend Prompted Text To, Or Delete Prompted Text From,
* The Beginning Of The Current Or Blocked Line(s),
* Initialize Find Prompt With Last Prompted Text
* (Tom Hogshead Modification Of ^F7)
*
* @(F7) --Insert Text At Beginning Of All Blocked Lines,
* (John Goodman, Author)
*
*
* (_) --{e:\up\COMT*}--Return To COMTxx.QM
*
*-- eoi
*
*
* ----------------------------------------------------------------------
* #(F4__) Surround Column-Blocked Text with Box of Desired Characters,
* John Goodman, author
********
* (Box Drawn Around Outside *Border* of Column Block, Juxtapose Text)
********
* ----------------------------------------------------------------------
* The following macro surrounds column-blocked text with a box of desired
* characters. Place text to be surrounded in a column block and press
* #F4. At the FillBlock prompt enter the desired border character. Box
* size is unlimited, including empty boxes, and boxes of one character
* up to surrounding full documents. Macro is INSERT mode insensitive,
* and there are no Find beeps because of failed searches. This macro
* was written by John Goodman.
* Starting with a block like this:
* 12345678901234567890
* 12345678901234567890
* 12345678901234567890
* 12345678901234567890
* 12345678901234567890
* Macro #F4 does this . . .
* 12345678901234567890
**********
* 12345*67890123*4567890
* 12345*67890123*4567890
* 12345*67890123*4567890
**********
* 12345678901234567890
#F4 macrobegin
GotoBlockBeg * Try going to block beg
JTrue START: * If we can, start processing
MarkColumn * Try completing the block
GotoBlockBeg * Try again to go to block beg
JFalse END: * If we can't, no block there
START:
Copy PasteOver * Copy the block and paste it back
InsertLine * Insert blank line at top
MarkLine * Make column block a line block
GotoBlockEnd * (Line) block end is directly below!
MarkColumn * Start a single column block
PrevPosition * Go back to where block began
CopyBlock CopyBlock * Copy column twice to shift text
CursorDown * Move down to reset block position
PasteOver * Paste orig block back in
CursorUp * Move to upper right of outer block
MarkColumn * Reset upper right corner
GotoBlockEnd * Go to block end
CursorRight * Move to where outer block will end
AddLine * Add extra line at bottom
MarkColumn * Mark outer block end point
FillBlock Pause Return * Prompt user for fill character
GotoBlockBeg * Go to outer block begin
CursorDown CursorRight * Move in for inner block
PasteOver * Put original block back in
UnmarkBlock * Clean up and go home!
END:
*
* 38 bytes Tue 05-07-1991 17:46:32
*
* ----------------------------------------------------------------------
* @(F4) Erase Outside Border of Column-Blocked Text and Collapse Text
* Surronding Block to Original Position Before Box Was Made
* John Goodman, author
* ----------------------------------------------------------------------
* Mark box border as a column block. @F4 erases outside border, returns
* and collapses all text surrounding block to original position before
* box was made. Use with caution since the lines containing the top
* and bottom edges of the block are deleted.
@F4 MacroBegin
GotoBlockBeg * Try going to block begin
JTrue START: * If we can, begin processing
MarkColumn * If not, mark block end
GotoBlockBeg * Try again to go to block begin
JFalse END: * If we can't, no block
START:
ShiftRight * Remove right edge of box
GotoBlockEnd * Go to end of block
MarkLine * Start Line block
PrevPosition * Return to block begin
GotoBlockEnd * new block end is directly below
MarkColumn * Start single column block
PrevPosition * Return to old block begin
CursorRight * Create 2-column block
MarkColumn * Finish marking block
DelLine * Delete top edge of box
GotoBlockEnd * Go to last line of block
DelLine * Delete bottom edge of box
DeleteBlock * Delete 1st two columns of block
END:
*
* 26 bytes Wed 05-08-1991 15:36:31
*
* ---------------------------------------------------------------
* @(F7) Insert Text at Beginning of All Blocked Lines (J GOODMAN)
* ---------------------------------------------------------------
*
@F7 MacroBegin
CursorRight * Needed for single-line blocks
GotoBlockBeg * Try going to block beg, retain pos.
JTrue BLK: * Determine if a completed block
DropAnchor * If not, DropAnchor will finish it
* or mark current line if none started
GotoBlockBeg * Go to block beg to retain position
BLK: GotoBlockEnd * Start at the end
FindReplace * Dummy to Allow for Safe Macro Escape
#224 Return * Char Unlikely to be Found
Pause Return * Allow User to Enter Repl Text
"LN" Return * Local, No Prompt Replace
MarkLine * Mark first line
PrevPosition * Return to beg of where block was
ShiftRight * Shift all lines to right
BegLine * Move cursor to column 1
GotoBlockEnd * Move to 1st char of last line
MarkColumn * Mark 1st character column
PrevPosition * Return to first line
BegLine * Needed for single-line blocks
FillBlock * Fill First Column with Char
#224 Return * Searched For Above
RepeatFind * Repeat the FindReplace
UnmarkBlock * Unmark the block
* 37 bytes Wed 04-17-1991 21:02:33
* =========================================================================
* Date: 05-01-91 (00:21) Number: 275 SemWare Support BBS
* To: TOM HOGSHEAD Refer#: NONE
* From: JOHN GOODMAN Read: NO
* Subj: MORE FOR REX Conf: 3 Macros
* ------------------------------------------------------------------------
* To Tom and Rex Edwards--
*
* Rex, I'm glad you're finding the comment macros useful! I hope
* Tom's followup comments will do the trick for you; I couldn't
* have recommended anything better.
*
*» Not to let Tom have the last word, however...
*»
*» The following macro is a first (very rough) attempt to merge
*» together the ideas in the comment/uncomment macro and the macro
*» that prepends a user-prompted string of text to blocked lines or
*» the current line (the idea for the second macro originated with
*» Richard Blackburn and it has been refined since then--I'm not
*» sure where Tom has put it in the AMAC files).
*»
* The macro below works the same as the comment/uncomment macro
* except that it will prompt for a text string. If the text string
* is found at the beginning of the 1st line of the block, the macro
* will delete that number of characters from the beginning of every
* line in the block. If the string is not found, it will add the
* string to the beginning of every line in the block.
*
*/ I have not had a chance to thoroughly test the macro or to try to
*/ streamline it, but I wanted to throw it out for comment (sic).
*/
* >>Tom, I'm running up against a deadline here at my real (i.e.,
* >>paying) job and may not be able to provide any further input on
* >>the JMPPOS macros for a couple of days. I scanned the last set
* >>you sent and everything looks great! Please don't let me hold
* >>you up if you want to get it out quickly.
* >>
* >>...JDG
*
* (Comments above added, deleted, then added again by #F7) |1.5
*
* -------------------------------------------------------------------
* ^(F7_) Prepend Prompted Text to, or Delete Prompted Text from,
* The Beginning of the Current or Blocked Line(s)
* -------------------------------------------------------------------
* (Note: I have changed John's character #128 to @250 so as to not be as
* noticeable.)
^F7 MacroBegin
CursorRight * Needed for single-line blocks
GotoBlockBeg * Try going to block beg, retain pos.
JTrue BLK: * Determine if a completed block
DropAnchor * If not, DropAnchor will finish it
* or mark current line if none started
GotoBlockBeg * Go to block beg to retain position
BLK: GotoBlockEnd * Start at the end
MarkLine * Mark line to close block
PrevPosition * Return to block begin
ShiftRight * Shift all lines to right
BegLine * Move cursor to column 1
GotoBlockEnd * Move to 1st char of last line
MarkColumn * Mark 1st character column
PrevPosition * Return to first line
BegLine * Needed for single-line blocks
FillBlock * FillBlock w/weird character
#250 Return
FindReplace * Replace Weird Char on 1st Line
#250 Return * with user-prompted text
DelLine
Pause #250 Return
"1" Return * 1st Occurrence (Line) Only
UnmarkBlock * Unmark the block
CursorLeft
MarkCharacter * Block the User's Text
BegLine
Cut * Cut Buffer Now Has Prompted Text
AddLine Paste * Save text on the following line
Find #250 Paste Return * Try to find weird char+text
"B" Return * on 1st line
JTrue DELTEXT:
* Text not found, add to every line
DelLine * Delete temp line
FindReplace #250 Return * Replace all occurrences of weird
Paste Return * char with user's text
"GN" Return
Jump END:
DELTEXT: * Text not found, shift right
GotoBlockEnd * Go to end of saved copy
DelLine * get rid of temp line
CursorUp * go back to 1st line in same col
MarkColumn * start col block, upper right
Find #250 Return * find last weird char, this becomes
"GB" Return * lower left corner of col block
DeleteBlock * delete the column block
CursorDown * reposition to run again
END:
*
* 84 bytes Tue 04-30-1991 23:51:49
*
* -------------------------------------------------------------------
* #(F7__) Prepend Prompted Text to, or Delete Prompted Text from,
* The Beginning of the Current or Blocked Line(s),
* Initialize Find prompt with last prompted text
* -------------------------------------------------------------------
* I changed John's ^F7 macro a bit so that the last prompt is
* remembered by Find. This is helpful for repetitive entries.
#F7 MacroBegin
CursorRight * Needed for single-line blocks
GotoBlockBeg * Try going to block beg, retain pos.
JTrue BLK: * Determine if a completed block
DropAnchor * If not, DropAnchor will finish it
* or mark current line if none started
GotoBlockBeg * Go to block beg to retain position
BLK: GotoBlockEnd * Start at the end
MarkLine * Mark line to close block
PrevPosition * Return to block begin
ShiftRight * Shift all lines to right
BegLine * Move cursor to column 1
GotoBlockEnd * Move to 1st char of last line
MarkColumn * Mark 1st character column
PrevPosition * Return to first line
BegLine * Needed for single-line blocks
FillBlock * FillBlock w/weird character
#250 Return
FindReplace * Replace Weird Char on 1st Line
#250 Return * with user-prompted text
* DelLine
CursorRight *|
Pause #250 Return
"1" Return * 1st Occurrence (Line) Only
UnmarkBlock * Unmark the block
CursorLeft
MarkCharacter * Block the User's Text
BegLine
Cut * Cut Buffer Now Has Prompted Text
AddLine Paste * Save text on the following line
Find #250 Paste Return * Try to find weird char+text
"B" Return * on 1st line
JTrue DELTEXT:
* Text not found, add to every line
DelLine * Delete temp line
FindReplace #250 Return * Replace all occurrences of weird
Paste Return * char with user's text
"GN" Return
Jump END:
DELTEXT: * Text not found, shift right
GotoBlockEnd * Go to end of saved copy
DelLine * get rid of temp line
CursorUp * go back to 1st line in same col
MarkColumn * start col block, upper right
Find #250 Return * find last weird char, this becomes
"GB" Return * lower left corner of col block
DeleteBlock * delete the column block
CursorDown * reposition to run again
END: *
FindReplace Return * *|
Paste * Re-initialize Find prompt with *|
* prompted text *|
Return Escape * Cancel FindReplace *|
*
* 84 bytes Tue 04-30-1991 23:51:49 (JG ^F7)
* 89 bytes Thu 05-02-1991 10:24:01 (TH |)
*
* ---------------------------------------------------------------------
* @(F8) Put colon in front of *rem* line for faster batch file operation
* ---------------------------------------------------------------------
* "Rem" lines in batch files make batch files run slower. Lines which
* are labels (colon as first character) do not. This macro simply puts
* a colon in column 1 for each line containing "rem ". Each rem line
* for my system takes about 0.2 seconds with disk cache, and 0.5 seconds
* per line with no disk cache. I found one batch file with 30 plus
* rem lines - 15 seconds less running time by labelling rem lines!
*
* NOTE: At least a space and one character of text must follow "rem"
* to be labelled, eg the following would not be labeled:
* rem
* echo remember
* The following would be labeled:
* rem this is a test
* echo harem holiday!
*
*
@F8 MacroBegin *
Begfile InsertLine * Insert blank line in case
* rem in col/line 1/1
Editfile "c:\!" Return * Load temp file
KillFile Quit * To kill/quit it
EditFile Return * Load empty temp file and
SaveFile * save it for append later
Quit * Quit it for now
START: *
Unmarkblock *
Find "rem " Return "I " Return * Find "rem "
Jfalse END: * No rem lines, end macro
BegLine *ELSE line has rem, go to bol
Dropanchor Wordright Dropanchor * Mark space up to "rem"
Shiftright * Shift line rt one space
Begline * Bak to bol
Find ":" Return "L" Return * See if line has colon at beg
Jtrue NEXT: *
Cursorright ":" *ELSE line has no colon, add it!
NEXT: *
Shiftleft * Shift line back lft one space
Markline *
WriteBlock Return "A" * Append line to c:\!
Endline Cursordown * Move off rem and chk for last
Jfalse END: * line
Cursorup *ELSE Line is not last, cur up
Jump START: * Loop again
END: *
Begfile * Begin of batch file
DelLine * Delete top blank line
Editfile Return * Load c:\!, look at rem lines
DelLine KillFile * with added colon, kill file
UnMarkBlock * Un mark batch file
*
* 82 bytes Mon 03-25-1991 16:49:26
*
* -----------------------------------------------------------
* @(8) Insert Text at Beginning of Blocked Lines (or Current
* Line If No Blocks Marked)
* John Goodman, Author
* -----------------------------------------------------------
* This macro will insert a user-prompted string of text in front of
* each line delineated by any type of block (character, line, or
* column). Only one block marker need be set. If no block markers
* are set, the current line will be acted upon. The text to be
* prepended should be entered by the user at the "Replace with:"
* prompt.
*
* The cursor will be placed at the beginning of the line following
* the line(s) acted upon so that the macro can be invoked
* repeatedly to prepend text to a series of lines. The macro
* should work consistently regardless of toggle mode or QConfig
* settings.
*
@8 MacroBegin
CursorRight * Needed for single-line blocks
GotoBlockBeg * Try going to block beg, retain pos.
JTrue BLK: * Determine if a completed block
DropAnchor * If not, DropAnchor will finish it
* or mark current line if none started
GotoBlockBeg * Go to block beg to retain position
BLK: GotoBlockEnd * Start at the end
FindReplace * Dummy to Allow for Safe Macro Escape
#250 Return * Char Unlikely to be Found
DelLine * Erase old prompt
Pause Return * Allow User to Enter Repl Text
"LN" Return * Local, No Prompt Replace
MarkLine * Mark first line
PrevPosition * Return to beg of where block was
ShiftRight * Shift all lines to right
BegLine * Move cursor to column 1
GotoBlockEnd * Move to 1st char of last line
MarkColumn * Mark 1st character column
PrevPosition * Return to first line
BegLine * Needed for single-line blocks
MarkColumn * Finish marking block
FillBlock * Fill First Column with Char
#250 Return * Searched For Above
RepeatFind * Repeat the FindReplace
GotoBlockEnd * Go to the last line
UnmarkBlock * Unmark the block
BegLine * Return to beginning of line
CursorDown * Go to next line
*
* 42 bytes Sat 07-27-1991 23:43:18 (JG)
* QCONFIG.DAT version of @8 above. Uncomment the lines and merge
* them together into a single line before placing in QCONFIG.DAT.
* @8 MacroBegin CursorRight GotoBlockBeg JTrue BLK: DropAnchor
* GotoBlockBeg BLK: GotoBlockEnd FindReplace #250 Return DelLine
* Pause Return "LN" Return MarkLine PrevPosition ShiftRight BegLine
* GotoBlockEnd MarkColumn PrevPosition BegLine MarkColumn FillBlock
* #250 Return RepeatFind GotoBlockEnd UnmarkBlock BegLine CursorDown