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
/
PAGE25.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
25KB
|
614 lines
* PAGE25.QM
* Macros To Paginate Text Files, Qmac Files and SLMR/OLX Messages
* Written by Tom Hogshead
* 6/18/92
*
* @f1 Number Pages in File Containing 'Page' <space> '-' ( ) |new
*
* @1 Paginate w/User Selected Page Length and Break Locations
* @4 Paginate Qmac Text Files w/User Selected Break Locations
* @2 Paginate SLMR/OLX Messages w/User Selected Break Locations
*
* @0 Remove Pagination From Text Files
* @5 Remove Pagination From Qmac Text Files
* @3 Remove Pagination From SLMR Messages
*
* -Select Breaks- -Add Page Numbers-
* @6 Paginate 66 LPP With No No
* @7 | Yes No
* @8 | Yes Yes, query
* @9 | Yes Yes, query bar
*
* @h Jump To Item or Macro In Index
*
* Description of Macros
* Files Included
* Change Settings and Running, How To
* Macros
* Other Macros Not Included
* Version History
*
*--eoi
* (Description)
* --------------
* PAGE25.QM macros paginate files, QMAC text files and SLMR/OLX
* messages so page break locations can be seen and moved for better
* readability.
* (Files)
* --------
* PAGExx.QM This txtfile of macros
* PAGExx.MAC Macfile converted from this txtfile with QMAC
* PAGE.TST 200 line file with line numbers to set parameters
* PAGE-QM.TST 200 line file with line numbers and asterisk in column 1
* PAGE.INF Description of macros
* (Change) Settings and Running
* ------------------------------
* For different settings change ** below with the following formulae:
* (PL-TM-BM-1)= 53, (TM-2)= 4, .... etc where TM= 6, BM= 6, PL= 66
* These macros paginate to 54 lines/page. Remember INSERT must be
* ON for some macros.
* Depending on whether a file is reloaded with no pagination or re
* paginated, there may be an extraneous carriage return and/or line
* feed present that cannot be removed when paginating. You may also
* see the top margin vary +- 1. Just be aware. Some printers may
* also handle files paginated with these macros differently.
* It is important that no lines in a file or a QMAC txtfile contain
* "page" space "-" or that and the subsequent line will be deleted
* when using some of the macros.
* To BEGIN, just type "START PAGE" <Enter>. All pertinent files will
* be loaded in the "Ring" for viewing, and PAGE25.MAC is read.
* Alternatively, type "START PAGE 0" <Enter> and the disk copies of
* all files in the "Ring" will be loaded ready for editing, saving
* time.
* These macros require "QEdit and QMAC v2.1, February, 1990" or later.
* Insert must be On.
* (Macros)
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Paginate With User Selecting Page Length and Page Break Location
* ----------------------------------------------------------------------
* This macro enables the user to paginate a file with user selecting
* the page length and final page break locations for better visibilty.
* At the first pause, enter the page length number of lines, then press
* <enter>. At each pause thereafter cursor up only to select the
* preferred location to insert each page break and press <enter>.
* Previous page breaks are removed before paginating. This macro
* requires QEdit v2.15.
@1 macrobegin
setscreenoff
REMOVE:
begfile
find #12 return delline return * Search for FF's
jfalse PAGE
delline * Delete all FF's in file
jump REMOVE * Loop 'till no more FF's
PAGE:
begfile
setscreenon
cursordown
repeatcmd
pause * Select page length # of lines
return
setscreenoff
cursorup * To compensate for repeatcmd
LOOP:
insertline
begline cursorright #24 cursorright * Instructions
"only, enter to set" * |
begline
unmarkblock markline markline
makectrofscreen
setscreenon
pause * Move cursor up to select loc
setscreenoff
deleteblock * Remove instructions
insertline
#12 * Insert FF at cursor
markcolumn
gotocolumn "80" return
fillblock #27 return * Make FF line visible
unmarkblock
begline
cursordown
repeatcmd return * Move to next FF loc
jtrue LOOP * Loop until eof
END:
begfile
*
* 101 bytes Tue 05-26-1992 03:49:09 (TH @1)
*
* ----------------------------------------------------------------------
* @(2) Paginate SLMR/OLX Messages,
* Remove Previous Pagination Before Pagination
* ----------------------------------------------------------------------
* This macro inserts page breaks in SLMR/OLX messages (.PG) every 144
* lines. The user is given the option at each prompt to position the
* page break for better visibility by moving the cursor up only to
* select the preferred location, and pressing <enter>. Previous page
* breaks are removed before paginating.
@2 macrobegin
REMOVE:
begfile
find ".PG" return delline return
jfalse PAGE
delline
jump REMOVE
PAGE:
begfile
LOOP:
cursordown 144
jfalse END
insertline
begline cursorright #24 cursorright
"only, enter to set"
begline
unmarkblock markline markline
makectrofscreen
pause
deleteblock
insertline
".PG"
cursordown
jump LOOP
END:
begfile
*
* 96 bytes Tue 05-26-1992 03:49:00 (TH @2)
*
* ----------------------------------------------------------------------
* @(3) Remove Pagination From SLMR Messages
* ----------------------------------------------------------------------
* This macro removes pagination inserted with @2 in SLMR Messages.
@3 macrobegin
REMOVE:
begfile
find ".PG" return delline return
jfalse END
delline
jump REMOVE
END:
begfile
*
* 23 bytes Mon 05-25-1992 16:03:59 (TH @3)
*
* ----------------------------------------------------------------------
* @(4) AUTOMATIC Page Breaks Only, NO Page #'s (For QMAC txtfiles only)
* ----------------------------------------------------------------------
* Be careful not to place page breaks within a macro. QMAC sometimes gets
* confused when page break lines are within macros, especially with labels.
* Place page breaks only between macros.
@4 macrobegin
setprintpagesize "0" return * cut off QEdit pagination
LABEL1: * & top/bottom margins
find #12 #27 return delline return
jfalse LABEL2
delline * delline if FF Esc found
jump LABEL1
LABEL2:
begfile find #10 return delline return
jfalse LABEL3
delline * delline if LF found
jump LABEL2
LABEL3:
begfile
#10 repeatcmd "3" return * insert 4 LF's on top
splitline cursordown ** set "3"=(TM-3) **
begline
LABEL4:
cursordown
repeatcmd "52" return ** set "52"=(PL-TM-BM-2) **
jfalse LABEL5
"Cursor only to between macros, ENTER to set"
return
cursorup markline markline
pause deleteblock begline
#42 #12 #27 repeatcmd "71" return * insert asterisk FF 72 Esc's
#10 repeatcmd "4" return ** set "4"=(TM-2) **
return
jump LABEL4
LABEL5:
endfile
return
#42 #12 #27 repeatcmd "77" return
begfile
*
* 193 bytes Sat 07-28-1990 15:20:09
* 191 bytes Mon 05-25-1992 15:24:23 (TH @4, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(5) Removes Pagination Only (For QMAC txtfiles only)
* ----------------------------------------------------------------------
@5 macrobegin
LABEL1:
begfile find #12 #27 return delline return
jfalse LABEL2
delline * Delline if FF Esc found
jump LABEL1
LABEL2:
begfile find #10 return delline return
jfalse LABEL3
delline * Delline if LF found
jump LABEL2
LABEL3:
begfile
*
* 37 bytes Sat 07-28-1990 15:20:29
* 35 bytes Mon 05-25-1992 15:24:28 (TH @5, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(6) AUTOMATIC Page Breaks Only, NO Page #'s
* ----------------------------------------------------------------------
@6 macrobegin setprintpagesize "0" return
lab1: begfile find #12 #27 return delline return
jfalse lab2 delline jump lab1
lab2: begfile find #10 return delline return
jfalse lab3 delline jump lab2
lab3: begfile find #12 return delline return
jfalse lab4 delch jump lab3
lab4: begfile find "page " "-" return delline return
jfalse lab5 delline delline jump lab4
lab5: begfile
#10 repeatcmd "4" return splitline cursordown ** set "4"=(TM-2) **
lab6: begline cursordown repeatcmd "53" return ** set "53"=(PL-TM-BM-1) **
jfalse lab7 begline #12 #27 repeatcmd "72" return
#10 repeatcmd "5" return return jump lab6 ** set "5"=(TM-1) **
lab7: endfile return begline #12 #27 repeatcmd "78" return begfile
*
* 136 bytes Sat 07-28-1990 15:20:38
* 132 bytes Mon 05-25-1992 15:24:32 (TH @6, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(7) Add Page Breaks To File Without Page Numbers And
* Remove Previous Pagination Before Pagination
* 66 Lines/Page, Top And Bottom Margins 6
* ----------------------------------------------------------------------
* This macro adds page breaks and top and bottom margins to
* files by inserting ASCII formfeed character #12 and linefeed
* character #10. Escape character #27 is used to make page break
* locations more visible. The macro is written to print 54
* lines/page with a top and bottom margin of 6. The user may
* change these settings by changing '**' below using the following
* formulae and recompiling with QMAC:
* (PL - TM - BM -1) = 53
* (TM - 2) = 4
* (TM - 1) = 5
* where TM = 6
* BM = 6
* PL = 66
* To run, press @7 with the cursor positioned anywhere in the
* file. At each prompt, move the cursor up only to select the
* preferred location for each page break, and press <enter>.
* Insert must be ON.
@7 macrobegin
setprintpagesize "0" return
lab1: begfile
find #12 #27 return delline return
jfalse lab2
delline
jump lab1
lab2: begfile
find #10 return delline return
jfalse lab3
delline
jump lab2
lab3: begfile
find #12 return delline return
jfalse lab4
delch
jump lab3
lab4: begfile
find "page " "-" return delline return
jfalse lab5
delline delline
jump lab4
lab5: begfile
#10 repeatcmd "4" return ** set "4"=(TM-2)
splitline cursordown
lab6: begline
cursordown repeatcmd "53" return ** set "53"=(PL-TM-BM-1)
jfalse lab7
"UP arrow key only, ENTER to set" return
cursorup markline markline
pause
deleteblock
begline
#12 #27 repeatcmd "72" return
#10 repeatcmd "5" return ** set "5"=(TM-1)
return
jump lab6
lab7: endfile
return
begline
#12 #27 repeatcmd "78" return
begfile
*
* 204 bytes Sat 07-28-1990 15:20:55 (TH @7)
* 204 bytes Sun 08-04-1991 12:15:44 (TH @7, opened up for clarity)
* 200 bytes Mon 05-25-1992 15:24:37 (TH @7, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(8) PAGINATE, Add Page #'s, NO Query Bar
* ----------------------------------------------------------------------
@8 macrobegin setprintpagesize "0" return
lab1: begfile find #12 #27 return delline return
jfalse lab2 delline jump lab1
lab2: begfile find #10 return delline return
jfalse lab3 delline jump lab2
lab3: begfile find #12 return delline return
jfalse lab4 delch jump lab3
lab4: begfile find "page " "-" return delline return
jfalse lab5 delline delline jump lab4
lab5: begfile
#10 repeatcmd "4" return splitline cursordown ** set "4"=(TM-2) **
lab6: begline cursordown repeatcmd "53" return ** set "53"=(PL-TM-BM-1) **
jfalse lab7 "UP arrow key only, ENTER to set" return cursorup
markline markline pause deleteblock begline #12 #27 repeatcmd
"72" return #10 repeatcmd "5" return return ** set "5"=(TM-1) **
"page " "--" return return cursorup cursorup centerline jump lab6
lab7: endfile return begline #12 #27 repeatcmd "78" return begfile
lab8: find "page " "-" return delline return
jfalse lab9 makectrofscreen cursorright repeatcmd "5" return
pause jump lab8
lab9: begfile
*
* 254 bytes Sat 07-28-1990 15:21:11
* 249 bytes Mon 05-25-1992 15:24:41 (TH @8, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(9) PAGINATE, Add Page #'s With Query Bar
* ----------------------------------------------------------------------
@9 macrobegin setprintpagesize "0" return
lab1: begfile find #12 #27 return delline return
jfalse lab2 delline jump lab1
lab2: begfile find #10 return delline return
jfalse lab3 delline jump lab2
lab3: begfile find #12 return delline return
jfalse lab4 delch jump lab3
lab4: begfile find "page " "-" return delline return
jfalse lab5 delline delline jump lab4
lab5: begfile
#10 repeatcmd "4" return splitline cursordown ** set "4"=(TM-2) **
lab6: begline cursordown repeatcmd "53" return ** set "53"=(PL-TM-BM-1) **
jfalse lab7 "UP arrow key only, ENTER to set" return cursorup
markline markline pause deleteblock begline #12 #27 repeatcmd
"72" return #10 repeatcmd "5" return return ** set "5"=(TM-1) **
"page " "--" return return cursorup cursorup centerline jump lab6
lab7: endfile return begline #12 #27 repeatcmd "78" return begfile
lab8: find "page " "-" return delline return
jfalse lab9 makectrofscreen begline "Enter page #, start p2 " *|
" " repeatcmd "13" return #25 return cursorup begline *|
markblockbegin endline markblockend cursordown begline
wordright cursorright repeatcmd "5" return pause
cursorup delline cursordown jump lab8
lab9: begfile
*
* 327 bytes Sat 07-28-1990 15:21:27
* 322 bytes Mon 05-25-1992 15:24:45 (TH @9, changed "n" to delline)
* 318 bytes Mon 05-25-1992 17:14:53 (TH @9 changed message *|)
*
* ----------------------------------------------------------------------
* @(0) Removes Pagination
* ----------------------------------------------------------------------
* This macro removes page breaks, top and bottom margins, and page
* numbers from a file paginated with any of the macros in
* PAGExx.QM. To run, press @0 with the cursor positioned anywhere
* in the file. The cursor returns to top of file after completion.
@0 macrobegin
lab1: begfile
find #12 #27 return delline return
jfalse lab2
delline
jump lab1
lab2: begfile
find #10 return delline return
jfalse lab3
delline
jump lab2
lab3: begfile
find #12 return delline return
jfalse lab4 delch
jump lab3
lab4: begfile
find "page " "-" return delline return
jfalse lab5
delline delline
jump lab4
lab5: begfile
*
* 78 bytes Sat 07-28-1990 15:21:44 (TH @0)
* 78 bytes Sun 08-04-1991 12:15:29 (TH @0, opened up for clarity)
* 74 bytes Mon 05-25-1992 15:24:50 (TH @0, changed "n" to delline)
*
* ----------------------------------------------------------------------
* @(f1) Number Pages in File Containing 'Page' <space> '-'
* ----------------------------------------------------------------------
* This macro will number pages in a file containing the word 'Page'
* followed by a single space and '-'. The maximum page number is 99,
* but macro can easily be modified to number an unlimited number of
* pages. The macro requires QEdit v2.15 and was written at the request
* of Carol Whitney in SemWare SmartNet Conference 23 Message #1533 June
* 17, 1992.
* This macro may also be incorporated in @8 and @9 to paginate files
* and automatically number pages.
* Example
* --------
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Page -
* Becomes
* --------
* Page - 1
* Page - 2
* Page - 3
* Page - 4
* Page - 5
* Page - 6
* Page - 7
* Page - 8
* Page - 9
* Page - 10
* Page - 11
@f1 macrobegin
setscreenoff
setautoindentmode toggleindent
onewindow
markcolumn * Mark pos in starting file
editfile 'nul' return quit * Load/quit nul
gotoblockend begfile * Return to bof
editfile return * Load nul as next file
markcharacter
'1234567890' * Insert counting line
shiftright * Put's space in col 1
storescrbuff 'c' return * Store to scratch buff 'c'
copy
delch * Remove '0' line 1
addline
begline paste * Insert another counting line
unmarkblock
COUNT:
begline markcolumn
getprev * Put ten's digit line 2 col 1
cut * Cut page # to scrap
NEXT_TEN:
prevfile
endline cursorright
find * Find
'Page ' '-' return delline return * empty page #
jfalse END
markword gotoblockend * Mark 'Page'
cursorright cursorright cursorright * Pos one spc rt of '-'
deltoeol * Delete any previous page #'s
paste unmarkblock * Insert page #
makectrofscreen
setscreenon setscreenoff
nextfile
cursorright
isendline jfalse NOT_EOL * Test if we need to jump 10
cursorup begline delch * Mpve next ten's to col 1
isemptyline jtrue QUIT
cursordown begline
markcolumn
getprev * Put ten's digit line 2 col 1
cut * Cut page # to scrap
getscrbuff 'c' return * Insert new one's line
begline
jump NEXT_TEN
NOT_EOL:
cursorleft * Re-position after eol test
jump COUNT * Count 'till no more pages
QUIT:
quit * Quit nul
END:
toggleindent
*
* 123 bytes Wed 06-17-1992 14:31:12 (TH @f1, to CW #23/1544)
*
* ----------------------------------------------------------------------
* @(h) Jump From Index Line To Locate Macro or Item In File Below
* ----------------------------------------------------------------------
* Alt_h can be used to quickly jump from Index Line to the desired
* item or macro in the file:
* 1. Press Alt and h at the same time. Line 1 is marked to
* highlight. Cursor down to desired line in Index.
* 2. Press Enter. The macro then locates and jumps to the item
* selected on the cursor line in the document below.
* See BOOKxx.Qm and JMPPOSxx.QM in AMACxx.ZIP for more discussion
* about using bookmarks and positions markers to jump to positions in
* files.
@h macrobegin
unmarkblock * Unmark any marked blocks
defaultwordset * In case altwordset on
begfile * Go to file begin
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
makectrofscreen * Cursor line center of window
find "(" paste ")"
return "I" return * Find first marked word in doc
jfalse NOMARK
begline * If mark found, go to begline
jump END
NOMARK:
begfile * if no mark found, go to begfile
END:
*
* 33 bytes Wed 07-10-1991 10:11:24 (TH)@h)
* (Other) Macros: See ALLMACRO.INF
* (Version) History
* ------------------
* 2.3f - Changed @7 and @0 documentation.
* In Amac40.zip.
* 2.3g - Corrected definitions of #10 and #12 on @7. 8/9/91
* - Opened up @7 and @0 for clarity, no macro change. 8/9/91
* 2.4 - Added @2 and @3 to Paginate SLMR messages. 5/25/92
* - Changed "n" to delline in all finds in @4-0. 5/25/92
* - Changed message in @9. 5/25/92
* - Added @1 for user selected page length, then paginate 5/25/92
* (In Amac43.zip)
* 2.5 - Added @f1 to automatically number pages. 6/17/92
*
*
*
*
*
*
*
*
*
*
*--eof