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
/
TOGL14.QM
< prev
next >
Wrap
Text File
|
1991-07-18
|
16KB
|
377 lines
* TOGL14.QM
* Written by Tom Hogshead
* With Macro Contributions by John Goodman and Steve Watkins
* July 18, 1991
*
* ┌───────────────────────────────[ (INDEX) ]────────────────────────────────┐
* │
* │ Macro (1) Bytes
* │ @(1) Force Insert Mode to ON JG 17
* │ @(9) Force Insert Mode to ON (alternate version) TH 16
* │ @(a) Force Insert Mode to ON (alternate version) SW 23|new
* │ @(b) Force Insert Mode to OFF SW 23|new
* │ @(2) Force EnterMatching Mode to ON JG 17
* │ @(3) Force AutoIndent Mode to ON JG 25
* │ @(4) Force WordWrap Mode to ON JG 6
* │ @(5) Force WordWrap Mode to OFF JG 7
* │ @(6) Force BoxDraw Mode to ON JG 19
* │ @(7) Prompt User for Desired Insert Mode State (1=ON, 0=OFF) JG 21
* │ @(8) Force Backups OFF TH 50
* │ @(h) Select Index item with cursor line, then <enter>. TH 22
* │
* │(Index) Use - How to locate macro or item below from Index using @h
* │(Description) - Search/Replace Macros
* │(Startup) - What's required
* │(Macros)
* │(Other) Macros - not included (1) Authors: TH-Tom Hoghsead
* │(Version) history JG-John Goodman
* │ SW-Steve Watkins
* └────────[ be sure to leave at least one blank line at end of Index ]─────┘
* (Description):
*
* TOGL14.QM contains QEdit macros to toggle Insert, AutoIndent,
* WordWrap, EnterMatching and BoxDraw ON, and Backups OFF.
* (Index) Use;
*
* To locate a macro or item in this file, press @h, place the cursor
* line on the desired item in the Index above, and press <enter>.
* See BOOKxx.QM for more details.
* These macros require "QEdit and QMAC v2.1, February, 1990" or later.
* (Startup):
*
* To BEGIN, just type "START TOGL" <Enter>. All pertinent files will be
* loaded in the "Ring" for viewing, and TOGL14.MAC is read.
* Alternatively, type "START TOGL 0" <Enter> and the disk copies of all
* files in the "Ring" will be loaded ready for editing, saving time.
* For (other) macros, see ALLMACRO.INF.
* (Macros)...................................
*
* =========================================================================
* Date: 04-18-91 (17:50) Number: 232-233 SemWare Support BBS
* To: TOM HOGSHEAD Refer#: NONE
* From: JOHN GOODMAN Read: NO
* Subj: TOGGLE ON Conf: 3 Macros
* ------------------------------------------------------------------------
*
* This file contains QEdit macros that perform functions similar to
* those in Tom Hogshead's TOGL12.QM file included in the AMACxx.ZIP
* file. The following macros may be used to force toggle modes to
* either ON or OFF regardless of their original state. Macros are
* provided to toggle Insert mode, EnterMatching mode, AutoIndent mode,
* WordWrap mode, and BoxDraw mode. Each of the macros will return the
* cursor to its original position after execution and should be
* reasonably tolerant of, and not modify, any other existing mode
* states or configuration settings.
*
* The last macro (@7) is an alternate version of the first macro
* (@1) that prompts the user to indicate whether they want Insert mode
* ON or OFF. Entering a 1 (one) at the prompt turns Insert mode ON;
* entering a 0 (zero) turns Insert mode OFF. This technique can be
* used with any of the other toggle macros and adds only 4 bytes to
* the macro size!
*
* John Goodman (Author)
*
* @(1) Force Insert Mode to ON
*-------------------------------------------------------
* The following macro toggles insert mode ON if it was previously OFF.
* The macro takes advantage of the fact that the Backspace command
* will delete a single-character block if insert mode is on, but will
* leave the block intact if insert mode is off. To make the macro
* always toggle insert mode OFF, change JFalse to JTrue.
@1 MacroBegin
UnmarkBlock * Ensure No Blocks Marked
InsertLine * Insert a Test Line
DropAnchor * Start a Character Block
"a" * Type Any Character
MarkCharacter * End Block for Just That Character
BackSpace * Backspace Over the Block
GotoBlockBeg * Test If Block Still Existing
JFalse CLEANUP: * Ins Mode Deletes Block; Overstrike Doesn't
ToggleInsert * Toggle Insert On If Block Still There
CLEANUP:
DelLine * Remove Test Line; Cursor at Orig Position
* 17 bytes Wed 04-17-1991 22:42:57
*
* @(2) Force EnterMatching Mode to ON
* ----------------------------------------------
* The following macro toggles EnterMatching mode ON if it was
* previously OFF. To make the macro always toggle EnterMatching mode
* OFF, change JTrue to JFalse.
@2 MacroBegin
UnmarkBlock * Ensure No Blocks Marked
InsertLine * Insert a Test Line
DropAnchor * Start a Block to Retain Cursor Pos
"(" * Type an Open Char to be Matched
DropAnchor * End the Block
EndLine * Try Moving to EOL: Cursor will move
JTrue CLEANUP: * only if matching char auto entered
ToggleEnterMatching * Toggle EnterMatching ON
CLEANUP:
GotoBlockBeg * Return to Original Cursor Pos
DelLine * Remove Test Line; Cursor at Orig Pos
* 17 bytes Wed 04-17-1991 22:43:21
*
* @(3) Force AutoIndent Mode to ON
*------------------------------------------------
* This macro toggles AutoIndent mode ON if it was previously OFF. This
* macro takes advantage of the fact that entering a carriage return
* with AutoIndent ON will indent the new line, whereas the cursor will
* be placed at the beginning of the line if AutoIndent is OFF. To
* make the macro always toggle AutoIndent mode OFF, change JTrue to
* JFalse.
@3 MacroBegin
UnmarkBlock * Ensure No Blocks Marked
InsertLine * Insert 1st Blank Line
DropAnchor DropAnchor * Set Block to Retain Cursor Pos
InsertLine * Insert 2nd Blank Line
BegLine * Go to Start of Line in case WW ON
CursorRight "a" * Move to 2nd Col and Type Char
Return * Type CR (creates 3rd line if Ins ON)
BegLine * Try Moving to BOL: If Indent OFF,
JTrue CLEANUP: * Cursor will already be at BOL
ToggleIndent * Toggle AutoIndent ON
CLEANUP:
CursorUp * Move Cursor to 1st Line
DropAnchor * Reset Beg Block Position
GotoBlockEnd * Go to End of Block
CursorDown * Move Out of Block and Back to
CursorLeft * Original Cursor Position
DeleteBlock * Delete the Mess We Created
* 25 bytes Wed 04-17-1991 22:44:32
*
* @(4) Force WordWrap Mode to ON
*-------------------------------------------------
* This macro toggles WordWrap mode ON if it was previously
* OFF. This macro takes advantage of the fact that setting
* the right margin, even to its default value, automatically
* turns WordWrap mode ON.
@4 MacroBegin * Simply Set Right Margin and Accept
SetRMargin Return * the Current Setting!
* 6 bytes Wed 04-17-1991 22:45:21
*
* @(5) Force WordWrap Mode to OFF
*-------------------------------------------------
* This macro toggles WordWrap mode OFF if it was previously
* ON. The macro first forces WordWrap ON by setting the
* right margin to its current default setting (as in @4 above),
* then toggles it to its opposite state (OFF).
@5 MacroBegin
SetRMargin Return * Force WordWrap ON
ToggleWordWrap * Toggle it OFF!
* 7 bytes Wed 04-17-1991 22:45:55
*
* @(6) Force BoxDraw Mode to ON
*--------------------------------------------------
* Basically the same as @2. Going CursorLeft with BoxDraw ON
* leaves a boxdraw character behind.
@6 MacroBegin
UnmarkBlock * Basically the same logic as @(2)
InsertLine
DropAnchor
"a"
DropAnchor
CursorRight
CursorLeft * This will leave an extra char behind if
EndLine * BoxDraw ON; EndLine tests for it
JTrue CLEANUP:
ToggleBoxDraw
CLEANUP:
GotoBlockBeg
DelLine
* 19 bytes Wed 04-17-1991 22:46:33
*
* @(7) Prompt User for Desired Insert Mode State (1=ON, 0=OFF)
*-------------------------------------------------------------
* This is an alternate version of @1 that prompts the user
* for the desired Insert mode state. Entering 1 (or any odd
* number) at the prompt turns Insert mode ON; entering 0 (or
* any even number) turns Insert mode OFF. Note additional
* four commands at the end of the macro.
@7 MacroBegin
UnmarkBlock * Ensure No Blocks Marked
InsertLine * Insert a Test Line
DropAnchor * Start a Character Block
"a" * Type Any Character
MarkCharacter * End Block for Just That Character
BackSpace * Backspace Over the Block
GotoBlockBeg * Test If Block Still Existing
JFalse CLEANUP: * Ins Mode Deletes Block; Overstrike Doesn't
ToggleInsert * Toggle Insert ON If Block Still There
CLEANUP:
DelLine * Remove Test Line; Cursor at Orig Position
*-- Added Lines for ON/OFF Prompting
ToggleInsert * Mode is Now ON, Turn it OFF
RepeatCmd * Prompt User for ON/OFF
Pause * Odd# = ON, Zero or Even# = OFF
Return * Finish Prompt for User
* 21 bytes Wed 04-17-1991 22:47:05
*
*-----------------------------------------------------
* @(8) Toggle backups OFF if ON, Tom Hogshead, author
*-----------------------------------------------------
* Change "c:" to ramdrive for faster operation.
*
@8 MacroBegin *
EditFile "c:!" Return * Edit temp file
BegFile * TOF if temp file is loaded
MarkBlockBegin EndFile MarkBlockEnd * Mark file to delete all of it
DeleteBlock Insertline * Delete it! Make 2 line file
SaveFile SaveFile * Save twice to make backup if
* backups toggled ON
Killfile Quit * Kill/quit c:!
EditFile "c:!.bak" Return * Load c:!.bak
Newfile Return * Exit and Edit c:!.bak
Gotoline "2" Return * Try to go to line 2
jfalse BAKOFF: * If line 2 not found, backups was OFF
* Test is false, go to BAKOFF
* ELSE backups was ON,
Togglebakups * and toggle backups OFF
BAKOFF: *
Killfile Quit * Kill/quit c:!.bak
*
* 50 bytes Tue 02-12-1991 12:14:46
*
*--------------------------------------------
* @(9) toggles Insert ON, Tom Hogshead author
*--------------------------------------------
*
* This macro is based on an alternate slightly longer version written
* by Kyle Watkins of SemWare. It is included here to show an
* alternate technique. It has the disadvantage of moving the cursor
* one space right when running.
*
@9 macrobegin
insertline * insert test line
"a" cursorleft "a" * insert "aa"
endline * if not at endline-insert is on
jtrue END: * if at endline -insert is off
toggleinsert * toggle on if off
END: *
delline * delete test line
*
* 16 bytes Fri 07-27-1990 22:44:42
* =======================================================================
* BBS: SemWare Support BBS
* Date: 05-23-91 (09:22) Number: 14090
* From: STEVE WATKINS Refer#: NONE
* To: FRED BRUCKER Recvd: NO
* Subj: INSERT MODE Conf: (0) Main Board
* -----------------------------------------------------------------------
* Here are some macros which allow you to turn the insert on or off.
* Note: Both of the following macros assume you do not use the "nul" file
* (I use is as a place marker). I have a work-around if necessary.
* Turn macro on (use toggle_insert to turn off - or the macro below)
*
* ----------------------------------------------------------------------
* @(a) Force Insert Mode to ON
* ----------------------------------------------------------------------
@a macrobegin
editfile "nul" return
'-'
cursorleft
'-'
endline
jTrue done
toggle_insert
done:
quit
* 23 bytes Thu 05-23-1991 17:12:43 (TH line added)
* Turn macro off
*
* ----------------------------------------------------------------------
* @(b) Force Insert Mode to OFF
* ----------------------------------------------------------------------
@b macrobegin
editfile "nul" return
'-'
cursorleft * cursorleft
'-'
endline
jFalse done
toggle_insert
done:
quit
* 23 bytes Thu 05-23-1991 17:12:33 (TH line added)
* Let us know if we can be of any further assistance.
* Steve Watkins
* SemWare Technical Support
* -----------------------
* Tom Hogshead comment about @a and @b:
* The techniques used in @a and @b have the advantage that the block
* condition and current file edit status is not changed. Screen
* changes are also slightly less than with my and John Goodman's
* techniques. Size of @a and @b is 6 to 7 bytes larger than @1 and @9.
*
* ----------------------------------------------------------------------
* @(h) Finds first word on cursor line marked in document below
* ----------------------------------------------------------------------
*
* Press @ and h at the same time. Cursor down to desired line in Index.
* Press <enter> to locate the desired item from the Index. See
* Bookxx.Qm in AMACxx.Zip for more discussion. Tom Hogshead, author.
*
@h macrobegin
begfile
unmarkblock
markline markline
pause
wordright
markword
copy
endpara
find "(" paste ")" return return
begline
*
* 22 bytes Tue 04-09-1991 16:23:53
* (Version) History:
* 1.0 Initial version, Alt9 & 0
* 1.1 Alt_6,7 & 8 added
* 1.1a Changed file name TOGGLE11 to TOGL11.
* 1.1b Modified this file documentation.
* 1.1c Modified this file documentation and added START.BAT.
* Changed TOGGLE file names to TOGL.
* 1.2 Added @5 toggle Backups OFF.
* 1.3 Removed @6-@8 and @0
* Changed @5 key to @8
* Added @1-@7 by John Goodman
* 1.4 Added @a and @b by Steve Watkins.
* Tom Hogshead