home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK5
/
DOS_34
/
AMAC44.ZIP
/
COM003.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
37KB
|
840 lines
* com003.qm
* Miscellaneous Commenting Macros
* Written By Tom Hogshead
* [ See COMTxx.QM For Use ]
* 6/22/92
* Key Description
* ===== ===============================================================
* @1 Fill 3 Character Wide Column Block With "Quote Comma Quote" ( )
* for Importing an Ascii Text File Into a Database
*
* @4 Insert Prompted Text Into Each Line of a Column Block
*
* @8 Insert Text at Beginning of Blocked Lines (John Goodman, Author)
*
* @9 Comment or Un-Comment Line or Block
* with '*»' in Col 1,
*» (like this)
*
* @0 Comment or Un-comment Line
* with '*--' in Col 1,
*-- (like this)
*
* @f1 Comment Non-macro Portion of File
* @f3 Comment Paragraph or Block
* @f4 Comment File
* @f5 Un-Comment File
* @f9 Builds a "Comment Box" for C Programmers
* @f10 Center C Program Comment
*
* #F4__ Surround Column-Blocked Text With Box Of Desired Characters,
* ********
* Box Drawn *Around* Outside Border
* ********
* of Column Block, Juxtapose Text
* (John Goodman, Author)
*
* @F4 Erase Outside Border Of Column-Blocked Text And Collapse Text
* Surronding Block To Original Position Before Box Was Made,
* (John Goodman, Author)
*
* ^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)
*
* @F8 Put Colon In Front Of "Rem" Lines For Faster Batch File Operation
*
* {e:\up\COMT*}--Return To COMTxx.QM
*
*-- eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Fill 3 Character Wide Column Block With "quote comma quote"
* for Importing an Ascii Text File Into a Database
* ----------------------------------------------------------------------
* This macro fills a 3 character wide column block with "quote comma
* quote" for importing an Ascii text file into a database. If QEdit
* 2.15 is not used, remove the "setscreenoff".
* Block Becomes
* vvv
* 689 543 689","543
* 842 874 842","874
@1 macrobegin
setscreenoff gotoblockend jtrue CLOSED markcolumn gotoblockend
jfalse END
CLOSED:
fillblock '"' return gotoblockbeg gotoblockend markline
prevposition cursorright gotoblockend markcolumn
prevposition fillblock ',' return unmarkblock
END:
*
* 31 bytes Sat 10-19-1991 11:24:27 (TH @1)
*
* ----------------------------------------------------------------------
* @(4) Insert Prompted Text Into Each Line of a Column Block
* ----------------------------------------------------------------------
* Mark a column block where text is to be inserted. At the pause,
* input the text to be inserted and press <enter>. Requires QEdit
* v2.15. For example, mark a colum block as shown:
* This macro was written for John Durso on the ILink Semware echo,
* Conference 21 April 30, 1992.
*
* xxxx,xxxx,xxxx,xxxx
* xxxx,xxxx,xxxx,xxxx
* xxxx,xxxx,xxxx,xxxx
* xxxx,xxxx,xxxx,xxxx
*
* Inputing "MIDDLE," at the pause becomes:
* xxxx,xxxx,MIDDLE,xxxx,xxxx
* xxxx,xxxx,MIDDLE,xxxx,xxxx
* xxxx,xxxx,MIDDLE,xxxx,xxxx
* xxxx,xxxx,MIDDLE,xxxx,xxxx
@4 macrobegin
setscreenoff * Turn off screen updates
horizontalwindow
editfile escape * For all Qconfig's *|
closewindow * Closes block if open
gotoblockbeg jfalse END * If false, no block, end macro
copyblock
fillblock "*" return * Insert dummy char to replace
setscreenon * Turn screen on for pause
findreplace
"*" return
pause * Insert text to replace
setscreenoff * Turn off last 'flicker'
return "LN" return * And finish insertion
unmarkblock
END:
*
* 45 bytes Thu 04-30-1992 21:56:47 (TH @1, to JD #21/5282)
* 30 bytes Fri 05-01-1992 01:27:06 (TH @4, shortened, changed key)
* 32 bytes Wed 05-13-1992 12:28:41 (TH @4, modified for all Qconfig's)
*
* -----------------------------------------------------------
* @(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)
*
*» -------------------------------------------------------------------
*» @(9) Comment or Un-Comment Line or Block with '*»' in Col 1
*» -------------------------------------------------------------------
* This macro comments and un-comments the current line or a marked
* block with '*»' in col 1 as follows:
* Commenting : Shifts text right two spaces
* Un-commenting : Shifts text left two spaces to original position
* Blank Lines : Not commented
* Fit Qconfig.dat : Yes
* Block Types : Line, column or character
* A line, column or character block may be marked before invoking,
* either open or closed, and all lines in block will be processed
* without pausing.
*» This paragaph is commented with this macro. Replace #175 "»" with
*» any character for alternate commenting second characters.
@9 MacroBegin
* ---------- Finish Marking Line or Block if Not Marked ----------*
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
* --------------- Test if Block Already Commented ---------------*
BegLine * Go to bol in case line block
CursorRight CursorRight * Move to column 3
Find "*" #175 Return * Test if line is already commented
* ( replace #175 with any character
* for alternate second character)
"LB" Return * (assumes all block commented or not)
Jfalse COMMENT * If no "*»" in col 1, must comment
* ----------------------- Un-Comment Block -----------------------*
UNCOMMENT: *ELSE
ShiftLeft ShiftLeft * Col 1 has "*»", remove it
ShiftLeft * Get rid of blank space
Jump END * End macro
* ------------------------ Comment Block ------------------------*
COMMENT:
ShiftRight ShiftRight * Shift all lines to right twice
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 block with space #32
#32 Return * (Change #32 to any ASCII character
* to comment blank lines)
FindReplace * Replace
#32 Return * space
"*" #175 Return * with "*»"
"LN" Return * Local, No Prompt Replace
END:
UnmarkBlock * Unmark the block
CursorDown * Go to next line
*
* 64 bytes Tue 04-30-1991 16:33:59
*
* ----------------------------------------------------------------------
* @(0) Comment or Un-Comment Line with '*--' in Col 1
*-- (like this)
* ----------------------------------------------------------------------
* This macro comments and un-comments the current line only with '*--'
* as follows:
* Commenting : Shifts text right 4 spaces
* Un-commenting : Shifts text left 4 spaces to original position
* Blank Lines : Commented
* Fit Qconfig.dat : Yes
* Block Types : None, marks current line
@0 macrobegin
unmarkblock markline
begline
shiftright
Find "*-" return * Test if line already commented
"L" return
jfalse ADD * If not, we need to add '*-- '
delch delch delch delch *ELSE delete 4 spaces
shiftleft
jump END
ADD:
begline
insertline * InsertLine for Insert set ON/OFF
"*--" * Insert commenting characters,
joinline
END:
begline unmarkblock
*
* 39 bytes Sun 06-23-1991 00:43:28 (TH)
*-- test
*
* ------------------------------------------------
* @(F1) Comment Non-Macro Portion of File
* ------------------------------------------------
@F1 MacroBegin
Begfile InsertLine * Insert temp line in case macro
START: * starts on line 1
MarkLine
Find " " "macrob" Return "I" Return * Find start of macro
Jtrue HAS_MACROB * If this para is a macro, go
* mark non-macro lines
EndPara *ELSE para is not a macro and
* go to end of para
Jump SHIFT * Go shift it
HAS_MACROB:
CursorUp MarkLine * Move up one line off macro
* and mark all non-macro lines
SHIFT:
ShiftRight ShiftRight * Shift block right
BegLine * Move cursor to column 1
GotoBlockBeg * Move to 1st char of first line
MarkColumn * Mark 1st character column
PrevPosition * Return to last line
BegLine * Needed for single-line blocks
FillBlock '*' Return * Fill 1st column with '*'
UnMarkBlock * Unmark non-macro block
EndPara NextPara * Move to para after macro
Jtrue START *ELSE at eof
UnMarkBlock * Unmark last non-macro block
BegFile DelLine * Go to tof, delete temp line
*
* 55 bytes Wed 03-27-1991 08:26:36 (TH @F1)
*
* ----------------------------------
* @(F3) Comment Paragraph or Block
* ----------------------------------
* @f3 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. Insert must be On.
@f3 Macrobegin
Gotoblockbeg
NEXT:
Endline Begline
Jfalse END
"* "
Cursordown
jump NEXT
END:
* 18 bytes Mon 08-20-1990 22:19:35
*
* --------------------
* @(f4) Comment File
* --------------------
@f4 macrobegin
unmarkblock
begfile markline
endfile markline
shiftright shiftright
begline
unmarkblock
markcolumn
begfile
fillblock '*' return
unmarkblock
*
* 20 bytes Tue 03-26-1991 14:57:37
*
* ----------------------------------------------------------------------
* #(F4__) Surround Column-Blocked Text with Box of Desired Characters,
********
* Box Drawn Around Outside *Border* of Column Block, Juxtapose Text
********
* (John Goodman, author)
* ----------------------------------------------------------------------
* 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
*
* ----------------------
* @(f5) Un-Comment File
* ----------------------
@f5 macrobegin
unmarkblock
endfile markline
begfile markline
shiftleft shiftleft
unmarkblock
*
* 12 bytes Tue 03-26-1991 14:57:43
*
* ---------------------------------------------------------------
* @(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)
*
* -------------------------------------------------------------------
* ^(F7_) Prepend Prompted Text to, or Delete Prompted Text from,
* The Beginning of the Current or Blocked Line(s),
* (John Goodman, author)
* -------------------------------------------------------------------
* (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
Editfile "c:\!" Return KillFile Quit EditFile Return
SaveFile Quit
START:
Unmarkblock
Find "rem " Return "I " Return
Jfalse END
BegLine Dropanchor Wordright Dropanchor Shiftright Begline
Find ":" Return "L" Return
Jtrue NEXT
Cursorright ":"
NEXT:
Shiftleft Markline WriteBlock Return "A"
Endline Cursordown
Jfalse END
Cursorup
Jump START
END:
Begfile DelLine Editfile Return DelLine KillFile UnMarkBlock
*
* 82 bytes Mon 03-25-1991 16:49:26
*
* ----------------------------------------------------------------------
* @(f9) Builds a "Comment Box" for C Programmers, Tim Farley, author
* ----------------------------------------------------------------------
*
* =========================================================================
* Date: 04-18-91 (10:02) Number: 230 SemWare Support BBS
* To: TOM HOGSHEAD Refer#: 229
* From: TIM FARLEY Read: NO
* Subj: COMMENTS ON @7 Conf: 3 Macros
* ------------------------------------------------------------------------
* TH> Very clever using FillBlock to fill a column 1 column block with dummy
* TH> character #224 and then replacing #224 with user input text. In all
* TH> cases I could think of it works perfectly - can't stump it!
*
* Another neat trick I like to use FillBlock for, is to make
* "boxes" of a single character.
*
* For instance, if you want to make a large box of asterisks, just
* mark a column block of the appropriate size and shape, do:
*
* FillBlock "*" Return
*
* Then do some appropriate cursor commands to move "in" one column
* in each direction from the edges of the block, mark again, and
* do:
*
* FillBlock " " Return
*
* Voila! A box of asterisks with space in the middle.
*
* With a few frills for "C", the complete macro looks like this:
*
*
* Builds a "comment box" for C programmers.
*
* The box starts on the left at the current indent level, and
* extends over to column 78 on the right.
*
* Assumes there is nothing to the right of the cursor on the current
* line at start. To handle that case, increase the number of SplitLines
* in line 2 of the macro.
*
@f9 MacroBegin
"/*" SplitLine 8 * start "C" comment
CursorDown CursorLeft * go to upper left of box
UnmarkBlock MarkColumn * start marking
GotoColumn "78" Return * extend box
CursorDown 6
MarkColumn * close mark
FillBlock "*" Return * and fill with *'s
CursorUp CursorLeft * move in one on lower right
GotoBlockBeg PrevPosition * remember old beginning
UnmarkBlock MarkColumn * start marking new block
PrevPosition * back to beginning
CursorDown CursorRight * move in one on upper left
MarkColumn * close mark
FillBlock " " Return * and fill with spaces
UnmarkBlock
CursorDown 6 CursorLeft "*/" * close "C" comment
CursorUp 5 * and move to spot to start
CursorRight * typing inside the block
* --Tim Farley
* ======================================================================
* Date: 03-28-91 (12:29) Number: 3716 SemWare Support BBS
* To: BOB DEHNHARDT Refer#: 3715
* From: RICHARD BLACKBURN Read: YES
* Subj: Macro Help! Conf: (21) ILink
* ----------------------------------------------------------------------
*
* ╒══>Quoting BOB from Date: 03-26-91 (10:36)
* │
* │1. Center the text I just typed in
* │2. Go to the beginning of the line, turn insert
* │off, and type a slash "/"
* │3. Type astericks (asterixes? stars.) up to one
* │space before my centered
* │4. Jump to one space after the centered text, and
* │continue entering stars until column 78
* │5. Go to the beginning of the next line, with insert
* │turned back on
* ╘══════════════════════════════════════════════════
*
*
* ----------------------------------------------------------------------
* @(f10) Center C Program Comment, Richard Blackburn, author
* ----------------------------------------------------------------------
* Here is a macro that will center a line and put "*'s" around your text.
* It will not change your Insert status.
*
@f10 MacroBegin ** Start Macro
UnMarkBlock * make sure no blocks marked
BegLine * goto start of line
DropAnchor * ---
DropAnchor * --- to save our place
CenterLine * center the line
GotoBlockBeg * goto begin of block
UnMarkBlock * un mark it
CursorLeft * cursor left twice
CursorLeft *
JFalse end * if not goto end line to long
MarkColumn * mark column
BegLine * goto beginning of line
DelCh * delete char incase in insert mode
"/" * put a / at start
MarkColumn * mark the column
FillBlock "*" Return * fill with *
Copy * copy to scrap buffer
EndLine * goto end of line
CursorRight * space over one
Paste * paste the * in here also
UnMarkBlock * un mark the block
end: BegLine * goto start of line
AddLine * and add a line
*
* 33 bytes Fri 03-29-1991 07:43:59 (added TH)
*
* This will do this
*
* /************************* This will do this *************************
* Leaving the cursor at the start of the next line.
* Richard Blackburn
* SemWare Technical Support
* Written Thu 03-28-1991 at 12:22:39