home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
editors
/
amac41.arj
/
BUFF12.QM
< prev
next >
Wrap
Text File
|
1991-08-26
|
50KB
|
929 lines
* BUFF12.QM
* Access Scratch Buffers with the Previous Buffer Name at Prompt
* Save and Reload Currently Loaded Buffers at Next Edit Session
* 8/25/91
*
* ─────────────────────────── INDEX ────────────────────────────
* @(1) - STORE or Copy Marked Block with Buffer Name at Prompt
* @(2) - GET or Insert Buffer Contents with Buffer Name at Prompt
* @(3) - APPEND Marked Block with Buffer Name at Prompt
* @(4) - Remove Buffer Contents with Buffer Name at Prompt
*
* @(7) - GET or Insert Buffer Contents Selected From a PickList P
* @(8) - Remove Buffer Contents Selected From a PickList
*
* @(6) - View Contents of All Currently Loaded Buffers
* @(9) - Save Contents of All Currently Loaded Buffers
* @(0) - Load Buffers From Previous Edit Session P
*
* (Description)
* (Configuration) Required <--- Please read this FIRST
* (Macros)
* (Version) History
*
*--- eoi
* (DESCRIPTION)
* These macros access and manipulate Scratch Buffers the same way
* StoreScrBuff, GetScrBuff and AppendScrBuff do except the last
* accessed buffer name is entered at the buffer name prompt when
* macros @1 - @4 are invoked. This is especially useful when a few
* Scratch Buffers are frequently accessed because QEdit does not
* remember and show the last accessed Scratch Buffer name at the
* buffer name prompt without having to recall and enter the buffer
* name. Macro @6 will show the contents of all loaded Scratch
* Buffers by name. Macros @7 and @8 enable the user to access
* Scratch Buffers from a PickList of all loaded Scratch Buffers by
* name. All currently loaded Scratch Buffers may also be saved
* with @9 and reloaded with @0 at the next edit session or at start
* up.
* All macros, except @0, will fit on one line of QCONFIG.DAT by
* removing the 'Label' and 'Macro_Begin' from the QMAC compiled
* macros and formatting with a right margin of 500, and then
* using joinline to get any remaining commands on the same line.
* Macros @1 - @6 will work with line, character or column blocks,
* however macros @7 -@0 will ONLY work with line or character
* blocks, NO column blocks.
* (CONFIGURATION)
* NOTE: Macros @1 - @4 are the only macros not requiring configuration.
* You must change 'e:\up\' in macros @6 - @0 to your directory
* containing the files for BUFFxx.QM macros, then recompile using
* QMAC. The following files must either exist or must be made as
* described below:
* BUFF.BAT batch file to invoke @0
* BUFF.NAM list of Scratch Buffer names to be used
* BUFF.ALL all currently loaded Scratch Buffers,
* @9 makes this file when invoked
* (MACROS)
*
* ----------------------------------------------
* @(0) Load Buffers From Previous Edit Session
* ----------------------------------------------
* This macro enables the user to load, either upon start up or
* while editing, all Scratch Buffers that were saved in the last
* edit session using @9. This macro is a modification of a macro
* in the QEdit documentation to load a set of "standard" buffers.
* @0 may also be invoked while editing.
* This macro will ONLY work with line or character blocks, NO
* column blocks. Any column block buffer saved with @9 will be
* loaded with @0 as a CHARACTER block. To run, invoke this macro
* at any time or at startup as described below, and the macro
* terminates with all buffers that were saved in the last editing
* session with @9 loaded and shown in the NUL file for viewing. The
* NUL file may be quit but this is not necessary.
* To invoke this macro at start up and load this file, it's macros,
* and the scratch buffers saved in the last editing session, use
* the following batch file BUFF.BAT contained in AMACxx.ZIP:
* ┌────────────────────── BUFF.BAT ──────────────────────┐
* │ │
* │ Q BUFF12.QM /EBUFF12.MAC /LBUFF12.MAC │
* │ │
* └──────────────────────────────────────────────────────┘
* The user may wish to modify BUFF.BAT by changing e:\up\ in the
* statement line to the directory containing BUFF.BAT so that all
* macros in BUFFxx.QM will be available to invoke from any
* directory. To invoke this macro while editing press @0.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.ALL. @0 must be the first macro in this
* file to autoexecute on start up. All Scratch Buffers will
* be changed to character blocks with @6 and @0.
@0 macrobegin
* ------------- Load Buffers From Previous Edit Session -------------*
editfile
'e:\up\BUFF.ALL' return * Load last buffer file
* Change 'e:\up\' to your directory
begfile * Go to the top of it
markline copy * Copy first buffer name to scrap
cursordown * Cursor down to first buffer
markblockbegin * Mark beginning of buffer
find #254 return delline return * Find the end of the buffer marker
markblockend * Mark the end of buffer
storescrbuff paste return * Store the buffer to name
cursordown * Cursor down to second buffer
LOOP: * Do same thing for next buffer
unmarkblock * Clear buffer content block
begline * Re-position from Find
markline * Mark buffer name
copy * Copy name to scrap
cursordown * Are we at bottom of file yet?
jfalse DONE: * If we can't cursor down, we're done
markblockbegin *ELSE mark buffer begin
repeatfind * Find end of buffer marker
cursorleft * Test if we're on marker in col 1
jtrue 1: * If true, we're not in col 1
insertline *ELSE we need to insert line for buff
cursordown * Move back to marker line
jump 2: * Bypass next line
1: cursorright * Position cursor back on marker
2: markblockend * Mark buffer end
storescrbuff paste return * Store buffer to name
cursordown * Cursor down to next buffer name
jump LOOP: * Loop again
DONE: * Come here when no more names
quit * Quit BUFF.ALL
* ---------- View Contents of All Currently Loaded Buffers ----------*
onewindow * In case @0 invoked while editing
editfile "NUL" return quit * Quit NUL file if loaded
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP2: *
begline * Needed in loop
unmarkblock *
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF: * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE: * If blank, go delete it
jump LOOP2: *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK: * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE: *
delline * Delete blank line
jump LOOP2: * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to view
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 162 bytes Tue 08-20-1991 11:21:31 (TH @0)
*
* --------------------------------------------------------------------------
* @(1) STORE or Copy Marked Block to Previous or New Buffer Name,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro copies the currently marked Block to the named Scratch
* Buffer. The last accessed buffer name is entered at request for
* buffer name prompt. Blocks may be either line, character or
* column blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer with
* this macro entering the name of the last accessed buffer invoked,
* on the 'Request for Buffer Name Prompt' line. If no buffer has
* been previously named with these macros, the 'Buffer Name Prompt'
* is blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the default Scratch Buffer name dot '.'
@1 macrobegin
onewindow
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Test if closed
jfalse END: *
storescrbuff "t" return * Store block to temp buff 't'
deleteblock * Delete block to put back later
horizontalwindow * Make two windows
editfile return * Load empty NUL file
"a" cursorleft "a" endline * Test line for Insert status
jfalse OFF: toggleinsert * Toggle Insert Off if On
OFF: delline * Delete test line
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT: * If buffer exists, bypass next line
dropanchor *ELSE make dummy block so cut does
* not cut empty line to scrap
NEXT: *
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
* unmarkblock *
markcharacter * Start character block
zoomwindow * Make NUL file full window
Pause * Pause for new name, or prev
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName: * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
getscrbuff "t" return * Insert temp buff 't'
storescrbuff paste return * Save it with new buff name
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff paste return * Put orig block back where it was
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 89 bytes Mon 08-19-1991 13:42:56 (TH @1)
*
* --------------------------------------------------------------------------
* @(2) GET or Insert Previous or New Buffer Name Contents at Cursor Position,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro inserts the contents of the named Scratch Buffer at
* the cursor position. The last accessed buffer name is entered at
* request for buffer name prompt. Blocks may be either line,
* character or column blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@2 macrobegin
onewindow * Close all windows
dropanchor * Mark starting file to return to
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Return to starting file
unmarkblock * Unmark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
"a" cursorleft "a" endline * Test line for Insert status
jfalse OFF: toggleinsert * Toggle Insert Off if On
OFF: delline * Delete test line
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT: * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT: *
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
* unmarkblock *
markcharacter * Start character block
zoomwindow * Make NUL file full window
pause * Pause for new name, or prev
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName: * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff paste return * Insert buff contents here
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 76 bytes Mon 08-19-1991 13:43:05 (TH @2)
*
* --------------------------------------------------------------------------
* @(3) APPEND Marked Block to End of Previous or New Buffer Name,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro appends the currently marked Block to the end of the
* named Scratch Buffer. The last accessed buffer name is entered
* at request for buffer name prompt. The existing contents of the
* named Scratch Buffer are not lost invoking this macro. If the
* named Scratch Buffer does not exist, a new Scratch Buffer will be
* created. Blocks may be either line, character or column
* blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@3 macrobegin
onewindow
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Test if closed
jfalse END: *
storescrbuff "t" return * Store block to temp buff 't'
deleteblock * Delete block to put back later
horizontalwindow * Make two windows
editfile return * Load empty NUL file
"a" cursorleft "a" endline * Test line for Insert status
jfalse OFF: toggleinsert * Toggle Insert Off if On
OFF: delline * Delete test line
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT: * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT: *
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
* unmarkblock *
markcharacter * Start character block
zoomwindow * Make NUL file full window
pause * Pause for new name, or prev
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName: * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
getscrbuff "t" return * Insert temp buff 't'
appendscrbuff paste return * Append block to buff 'n'
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff "t" return * Put orig block back where it was
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 90 bytes Mon 08-19-1991 13:43:01 (TH @3)
*
* --------------------------------------------------------------------------
* @(4) Remove Buffer Contents with Previous Buffer Name at Prompt
* --------------------------------------------------------------------------
* This macro removes the contents of the named Scratch Buffer. The
* last accessed buffer name is entered at request for buffer name
* prompt. Blocks may be either line, character or column
* blocks--open or closed. This macro is useful for freeing up
* buffer space or removing buffers before saving with @9.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@4 macrobegin
onewindow * Close all windows
dropanchor * Mark starting file to return to
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Return to starting file
unmarkblock * Unmark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
"a" cursorleft "a" endline * Test line for Insert status
jfalse OFF: toggleinsert * Toggle Insert Off if On
OFF: delline * Delete test line
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT: * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT: *
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
markcharacter * Start character block
zoomwindow * Make NUL file full window
pause * Pause for new name, or prev
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName: * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
toggleinsert * Toggle Insert back On
endline dropanchor * Mark empty block
storescrbuff paste return * Store empty block to buff n
* clears it
quit * Quit NUL file
prevwindow * Return to starting file
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 78 bytes Tue 08-20-1991 11:34:56 (TH @a)
*
* ----------------------------------------------------
* @(6) View Contents of All Currently Loaded Buffers
* ----------------------------------------------------
* This macro enables the user to view the contents of all currently
* loaded Scratch Buffers. This macro uses the technique in a macro
* in the QEdit documentation to load a set of "standard" buffers.
* This macro will ONLY work with line or character blocks, NO
* column blocks. To run, press @6 and <enter> and the contents of
* all currently loaded Scratch Buffers is shown in the NUL file for
* viewing in the following form:
* ┌────── NUL ──────┐
* │1 │<-- Buffer 1 name
* │Text of buffer 1■ │<-- Buffer 1 content
* │2 │<-- Buffer 2 name
* │This is content of │<-- Buffer 2 content
* │buffer number 2. │ |
* │ │ |
* │Note that buffers may │ |
* │contain any text │ |
* │except for an ASCII │ |
* │254. That is used │ |
* │as an end of buffer │ |
* │marker │ |
* │■ │<-- NOTE: delimiter on line by itself
* │3 │ indicates a blank line.
* │Buffer 3■ │
* └──────────────────────┘
* After viewing the buffer contents, the NUL file may be quit but
* this is not necessary.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily made as shown below.
* File BUFF.NAM is a list of buffer names to be used:
* 1 to 10
* a to z (excluding n and t)
* . (dot)
* ┌───── BUFF.NAM ──────┐
* │1 │<-- Buffer names 1 - 10
* │2 │
* │3 │
* │4 │
* │5 │
* │6 │
* │7 │
* │8 │
* │9 │
* │10 │
* │a │ <-- Buffer names a - z
* │b │ excluding 'n' and 't'
* │| │ reserved for BUFFxx.QM macros.
* │| │
* │z │
* │. │ <-- Buffer name '.' (dot) is
* └──────────────────────┘ reserved as default name.
@6 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP: *
begline * Needed in loop
unmarkblock *
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF: * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
jtrue 1:
gotoblockend
1: #254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE: * If blank, go delete it
jump LOOP: *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK: * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE: *
delline * Delete blank line
jump LOOP: * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to view
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 78 bytes Mon 08-19-1991 13:43:19 (TH @6)
* 94 bytes Tue 08-20-1991 11:22:00 (TH @6, added e:\up)
*
* ---------------------------------------------------------
* @(7) GET or Insert Buffer Contents at Cursor Position
* From a PickList of All Currently Loaded Buffers
* ---------------------------------------------------------
* This macro enables the user to insert a Scratch Buffer at the
* cursor position selected from a PickList of all currently loaded
* Scratch Buffers. At the pause, place the cursor line on the name
* of the buffer to insert and press <enter>. The selected buffer
* will be inserted at the cursor position when this macro was
* invoked.
* This macro will ONLY work with line or character blocks, NO
* column blocks.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily be made as shown below.
@7 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP: *
begline * Needed in loop
unmarkblock *
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF: * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE: * If blank, go delete it
jump LOOP: *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK: * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE: *
delline * Delete blank line
jump LOOP: * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to select
pause * Pause to select
markline copy * Copy selected buffer name to scrap
prevwindow * Return to starting file
getscrbuff paste return * Insert selected buffer contents here
prevwindow * Return to NUL
quit * Quit NUL
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 99 bytes Tue 08-20-1991 11:21:50 (TH @7)
*
* ----------------------------------------------------
* @(8) Remove Buffer Contents Selected From a
* PickList of All Currently Loaded Buffers
* ----------------------------------------------------
* This macro enables the user to remove an un-desired Scratch
* Buffer from currently loaded Scratch Buffers selected from a
* PickList of all currently active Scratch Buffers. At the pause,
* place the cursor line on the name of the buffer to remove and
* press <enter>. The selected buffer will be removed or cleared
* from currently loaded Scratch Buffers as can be confirmed
* invoking @6 after @8. This macro is useful for either freeing up
* memory or removing macros not wished to be saved with @9.
* This macro will ONLY work with line or character blocks, NO
* column blocks.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily be made as shown below.
@8 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP: *
begline * Needed in loop
unmarkblock *
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF: * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE: * If blank, go delete it
jump LOOP: *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK: * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE: *
delline * Delete blank line
jump LOOP: * Loop again
PICK: * Come here to select from PickList
unmarkblock * Clear last buffer content's block
zoomwindow * Full window for visibity
begfile * Position to select
pause * Pause to select
markline copy * Copy selected buffer name to scrap
endline * Position of empty space
dropanchor * Mark empty space
storescrbuff paste return * Store empty block to selected buff
* removes buffer contents
* begline *
unmarkblock * Unmark
quit * Quit NUL
prevwindow * Return to starting file
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 101 bytes Tue 08-20-1991 11:18:24 (TH @8)
*
* ----------------------------------------------------
* @(9) Save Contents of All Currently Loaded Buffers
* To Reload at Next Edit Session with @0
* ----------------------------------------------------
* This macro saves the contents of all currently loaded Scratch
* Buffers to a file BUFF.ALL to be loaded at the next edit session
* or while editing using @0. This macro will ONLY work with line
* or character blocks, NO column blocks. Any column block buffer
* saved with @9 will be loaded with @0 as a CHARACTER block. To
* run, invoke this macro at any time, and the macro terminates with
* the file BUFF.ALL containing all Scratch Buffers currently active
* and having names contained in the file BUFF.NAM, loaded for
* viewing. Terminate the editing session or quit the file BUFF.ALL
* to continue.
* NOTE: You must change 'e:\up\' to your directory containing
* BUFF.ALL and BUFF.NAM.
* File BUFF.NAM must exist and is a list of buffer names used. It
* is included in AMACxx.ZIP and contains the following buffer names
* in col 1.
* 1 to 10
* a to z
* . (dot)
* Edit BUFF.NAM to suit your needs. Buffer names may also be
* multiple words.
* ┌───── BUFF.NAM ──────┐
* │1 │<-- Buffer names 1 - 10
* │2 │
* │3 │
* │4 │
* │5 │
* │6 │
* │7 │
* │8 │
* │9 │
* │10 │
* │a │ <-- Buffer names a - z
* │b │ excluding 'n' and 't'
* │| │ reserved for BUFFxx.QM macros.
* │| │
* │z │
* │. │ <-- Buffer name '.' (dot) is
* └──────────────────────┘ reserved as default name.
* The file BUFF.ALL is the contents of Scratch Buffers (Sample from
* my last editing session is included in AMACxx.ZIP) saved with @9
* in the form:
* ┌────── BUFF.ALL ──────┐
* │1 │<-- Buffer 1 name
* │Text of buffer 1■ │<-- Buffer 1 content
* │2 │<-- Buffer 2 name
* │This is content of │<-- Buffer 2 content
* │buffer number 2. │ |
* │ │ |
* │Note that buffers may │ |
* │contain any text │ |
* │except for an ASCII │ |
* │254. That is used │ |
* │as an end of buffer │ |
* │marker │ |
* │■ │<-- NOTE: delimiter on line by itself
* │3 │ indicates a blank line.
* │Buffer 3■ │
* └──────────────────────┘
* Buffers to be saved may contain any ASCII character except #254,
* the end of buffer marker. All scratch buffers are loaded and
* marked as CHARACTER blocks.
@9 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP: *
begline * Needed in loop
unmarkblock *
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF: * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE: * If blank, go delete it
jump LOOP: *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK: * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name with no content
DELLINE: *
delline * Delete blank line
jump LOOP: * Loop again
PICK: *
writeblock * Begin writeblock
backspace backspace backspace * Remove 'nam' extension
"ALL" return "O" * Save all scratch buffer contents
* to BUFF.ALL with overwrite
editfile return quit * Quit BUFF.ALL if loaded
editfile return * Load BUFF.ALL to see if all Ok
onewindow * Close windows
END: *
*
* 105 bytes Tue 08-20-1991 11:22:05 (TH @9)
* (VERSION) HISTORY
* 1.0 - Initial. Includes @1, @2 and @3. 8/17/91
* - 1.0 posted SemWare Macros Conference to D Thompson and 8/17/91
* and J Goodman.
* 1.1 - Added @6. Modified @1, @2 and @3. 8/19/91
* 1.2 - Added @4 and @7 - @0. 8/20/91
* - Swapped @2 and @3 keys. 8/22/91
* - @1 ans @2 sent to Joseph Carnage (RelayNet). 8/22/91
*
*
*
*
*
*-- eof
*
* - @1 ans @2 sent to Joseph Carnage. 8/22/91
*
*
*
* To: Mike Nolan and ALL 8/19/91
* I hope you don't mind me posting these new macros to your
* attention. I am doing so hoping you (and anyone else caring to)
* might be able to test them and also to show you, as a result of
* your suggestions and constructive criticism of the AMAC
* documentation, what I think may be *better* documentation. I
* will be interested to hear what you think. Let me assure you, I
* am always in the mood for constructive criticism and suggestions,
* so fire something back if and when you can. I won't be offended
* if you can't or don't respond.
* Please NOTE: @6 requires that 'e:\up\' (my directory) be changed
* to your directory containing the file BUFF.NAM
* which is a list of Scratch Buffer names that needs
* to be made before using @6 as explained below.
* I am encouraged by how well these macros are developing for the
* user to be able to access Scratch Buffers quickly without having
* to retype a buffer name each time unless the name is different
* from the last accessed Scratch Buffer. I found several
* conditions where my macros posted in SemWare Macros Conference 3,
* Messages 581-584, did not work properly. The following macros in
* the continuing messages are revisions to these macros @1, @3 and
* @2 sent previously which should now work properly. I am also
* including a new macro @6 to View Contents of All Currently Loaded
* Scratch Buffers. These macros access Scratch Buffers identical
* to how StoreScrBuff, AppendScrBuff and GetScrBuff work except the
* last accessed buffer name is entered at the buffer name prompt
* allowing for quicker Scratch Buffer access. QEdit does not
* currently show the last accessed buffer name at the buffer name
* prompt. These macros should be useful for quickly accessing
* Scratch Buffers.
* NOTE: To use @6 you must change 'e:\up\' in macro @6 to your
* directory containing BUFF.NAM. This file must exist for
* this macro to work, and it is easily be made as shown
* below.
* I am still working to come up with a way to select a Scratch
* Buffer name from a PickList of all currently loaded Scratch
* Buffers showing buffer name and contents, and a macro to
* autoexecute on start up and load all Scratch Buffers active in
* the last editing session. This was not as easy to do as I
* expected. If you are interested I will be glad to post these if
* and when I get them working properly. Just let me know.
* If you find any problems with these new macros or have any
* suggestions or criticism, I would really like to know. Thanks.
* ... Tom
* To: John Goodman and ALL 8/17/91
* The following macros (@1, @3 and @2 in the three continuing
* messages) are my first effort to Copy, Append or Insert Scratch
* Buffers in a manner identical to how StoreScrBuff, AppendScrBuff
* and GetScrBuff work except the last accessed buffer name is
* entered at the buffer name prompt allowing for quicker Scratch
* Buffer access:
* These macros are useful for quickly accessing Scratch Buffers
* They will fit on one line of QCONFIG.DAT by removing the 'Label'
* and 'Macro_Begin' from QMAC compiled @1 and @3 macros. If you are
* interested in having macros to be able to select a Scratch Buffer
* name from a PickList of all active Scratch Buffers showing buffer
* name and contents, and a macro to autoexecute on start up and
* load all Scratch Buffers active in the last editing session,
* please let me know, and I'll try to put something together. I
* think this can be done, but it will require some work.
* If you find any problems with these new macros, I would really
* like to know. No effort has been spent optimizing, and I also
* would like to hear any suggestions or comments. Thanks.
* ... Tom