home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib37a.dsk
/
AUGUST.1989
/
UltraSolutions.txt
< prev
Wrap
Text File
|
2023-02-26
|
12KB
|
348 lines
start
-----------------
ULTRA SOLUTIONS
By Mark A. Heath
Copyright(c) 1989
MindCraft Publ. Corp.
Concord, Ma 01742
Block Operations:
-----------------
<ba-down>:<awp : msg ' Select SUBscript text and press RETURN ' : C = 5 :
ba-Ctrl-\>! Select Subscript text
<ba-up>:<awp : msg ' Select SUPERscript text and press RETURN ' : C = 4 :
ba-Ctrl-\>! Select Superscript text
<ba-B>:<awp : msg ' Select the text to be BOLDFACED and press RETURN ' :
C = 3 : ba-Ctrl-\>! Select boldface text
<ba-C>:<awp : msg ' Select the text to be CENTERED and press RETURN ' :
C = 1 : ba-Ctrl-\>! Select Centered text
<ba-G>:<awp : msg ' Select GROUP and press RETURN ' : C = 2 :
ba-Ctrl-\>! Select Group of text
<ba-U>:<awp : msg ' Select the text to be UNDERLINED and press RETURN ' :
C = 6 : ba-Ctrl-\>! Select underlined text
-----------
<ba-Ctrl-\>:<awp : { Vars used : B,C,K,L,R,T,X,Y }
posn L,T : { Save original cursor position }
oa-C : print "T" : { Use the 'Copy' function to select text }
begin : K = key : if K = 27 then esc msg '' : stop :
{ End macro if ESC is pressed }
else if K = 13 then
posn R,B { Get final cursor position }
esc ba-Ctrl-] : { Set R,B,T,L correctly }
else print chr$ K : rpt : { Wait until user hits C/R or ESC }
elseoff : begin : { Move cursor to bottom line of selection }
posn X,Y :
if Y > B then up rpt : else
if Y < B then down rpt : else
begin : { Move cursor to rightmost col. of selection }
posn X,Y :
if X < R then right rpt : else
if X > R then left rpt : else
ba-Ctrl-_ :{ Perform appropriate action at bottom of selection }
begin : { Move cursor to top line of seleciton }
posn X,Y :
if Y > T then up rpt : else
begin : { Move cursor to leftmost col. of selection }
posn X,Y :
if X > L then left rpt : else
if X < L then right rpt : else
C = C + 20 : ba-Ctrl-_>! Perform appropriate action at top
Select block, perform operation #C. Used by ba-down ba-up ba-b
ba-c ba-g ba-u
-----------
<ba-Ctrl-]>:<awp : { Vars used: A,B,L,R,T }
if T > B then { Switch T & B, R & L }
A = T : T = B : B = A : A = L : L = R : R = A :
else if T = B then { Do we need to switch L & R }
if L > R then A = L : L = R : R = A>!
Reset T,B,L,R if necessary, used by ba-Ctrl-\
-----------
<ba-Ctrl-_>:<awp : { Vars used : C }
if C = 1 then down oa-O print "UJ" : rtn esc : elseoff
if C = 21 then oa-O print "CN" : rtn esc : elseoff
if C = 2 then down oa-O print "GE" : rtn esc : elseoff
if C = 22 then oa-O print "GB" : rtn esc : elseoff
if C = 3 then right oa-O print "BE" : rtn esc : elseoff
if C = 23 then oa-O print "BB" : rtn esc : elseoff
if C = 4 then right oa-O print "+E" : rtn esc : elseoff
if C = 24 then oa-O print "+B" : rtn esc : elseoff
if C = 5 then right oa-O print "-E" : rtn esc : elseoff
if C = 25 then oa-O print "-B" : rtn esc : elseoff
if C = 6 then right oa-O print "UE" : rtn esc : elseoff
if C = 26 then oa-O print "UB" : rtn esc>!
Perform operation #C, used by ba-Ctrl-\
---------------------
Page Numbers: (sa-#)
---------------------
#:<awp : { Vars Used: K }
insert : msg 'This macro will remove page headers, footers and
margins. Continue? Y/N ' :
K = key : if K > 94 then K = K - 32 : elseoff :
{ Get a key, convert it to uppercase if necessary }
if K = 89 then
sa-M : { Set Marker #254 (save initial position }
zoom oa-Z oa-1
ba-ctrl-W : { Remove headers, footers, top & bottom mgns }
oa-1 oa-O print "TM" : rtn print ".5" : rtn print "BM" : rtn
print ".5" : rtn esc { Set top and bottom margins }
ba-ctrl-V : ba-ctrl-X { Prompt for page numbers }
else : msg '' : zoom>! Insert Page Numbers
-----------
<ba-ctrl-R>:<awp :
oa-1 sa-K print "1" : rtn rtn up oa-O print "HE" : rtn esc rtn up
{ Make a blank header for all but the first page }
ba-ctrl-Z : { Put page number in the blank line }
sa-K print "2" : rtn rtn up oa-O print "FO" : rtn esc rtn up
ctrl-L ctrl-L>! { Make a blank footer }
Other pages: top Used by sa-#
------------
<ba-ctrl-S>:<awp :
oa-1 sa-K print "1" : rtn rtn up oa-O print "HE" : rtn esc rtn up
ctrl-L ctrl-L { Make a blank header }
sa-K print "2" : rtn rtn up oa-O print "FO" : rtn esc rtn up
{ Make a blank footer }
ba-ctrl-Z>! { Put page number in the blank footer }
Other pages: bottom Used by sa-#
------------
<ba-ctrl-T>:<awp :
oa-1 sa-K print "1" : rtn rtn up oa-O print "HE" : rtn esc rtn up
ctrl-L ctrl-L { Make a blank footer for the top }
sa-K print "2" : rtn rtn up oa-O print "FO" : rtn esc rtn up
ctrl-L ctrl-L>! { Make a blank footer for the bottom }
Other pages: None. Used by sa-#
------------
<ba-ctrl-V>:<awp : { Vars used : $1 }
oa-1 down down oa-O print "HE" : rtn esc rtn up ctrl-L ctrl-L
{ Make a blank Header for the first page }
rtn oa-O print "FO" : rtn esc
{ Make a blank footer for the first page }
msg 'Page Nos.: 1st page: B)ottom N)one' :
K = key : if K > 94 then K = K - 32 : elseoff :
{ Get uppercase key }
if K = 27 then goto ba-ctrl-X : { ESC pressed, exit }
else if K = 66 then ba-ctrl-Z : { Do Left/Center/Right }
else : ctrl-L ctrl-L : { make footer blank }
elseoff : sa-K print "2" : rtn $1 = "Not found" :
if $1 = screen 1, 24, len $1 then { No more pages, quit }
spc oa-1 zoom : stop :
else : rtn msg 'Other Pages: T)op B)ottom N)one' :
K = key : if K > 94 then K = K - 32 : elseoff :
{ Get uppercase Key }
if K = 27 then goto ba-ctrl-X : { ESC pressed, exit }
else if K = 84 then ba-ctrl-R : stop : else : { Top }
if K = 66 then ba-ctrl-S : stop : else : { Bottom }
ba-ctrl-T>! { None }
Prompt for page numbers. Used by sa-#
------------
<ba-ctrl-W>:<awp : { Vars Used: $1 }
$1 = "Not found" : oa-1 begin :
oa-F print "OHE" : rtn { Find a header }
if $1 = screen 1, 24, len $1 then spc { not found }
else : rtn oa-D down sa-right : rtn rpt : elseoff :
{ Header found, delete it }
oa-1 begin :
oa-F print "OFO" : rtn { Find a footer }
if $1 = screen 1, 24, len $1 then spc { not found }
else : rtn oa-D down sa-right : rtn rpt : elseoff :
{ Footer found, delete it }
oa-1 begin :
oa-F print "OTM" : rtn { Find a top margin }
if $1 = screen 1, 24, len $1 then spc { not found }
else : rtn oa-D rtn rpt : elseoff :
{ Top margin found, delete it }
oa-1 begin :
oa-F print "OBM" : rtn { Find a bottom margin }
if $1 = screen 1, 24, len $1 then spc { not found }
else : rtn oa-D rtn rpt : elseoff>!
Removes headers, footers, bottom margins, and top margins.
Used by sa-#
------------
<ba-ctrl-X>:<awp : sa-G : print "N" : oa-D : rtn : msg '' : stop>!
Go back to original spot and stop macro
------------
<ba-ctrl-Z>:<awp :
msg ' L)eft C)enter R)ight ' :
K = key : if K > 94 then K = K - 32 : elseoff :
{ Get uppercase key }
if K = 27 then goto ba-ctrl-X : { ESC pressed, exit }
else if K = 76 then oa-O print "PP" : rtn esc else :
{ Page number: Left }
if K = 67 then up oa-O print "CN" : rtn esc down oa-O print "PP" :
rtn esc down oa-O print "UJ" : rtn esc : up sa-right : else :
{ Page number: Centered }
if K = 82 then ba-right : left left left oa-O print "PP" :
rtn esc>!
{ Page number: Right }
Do Left/Center/Right for all pages. Used by sa-#
<left>:<awp><oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab
oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab oa-tab
oa-tab>! Go to left margin (Used by sa-right)
<right>:<awp><sa-left : down left>! Go to end of line (Used by sa-#)
<ba-right>:<awp><tab tab tab tab tab tab tab tab tab tab tab tab tab tab tab
tab tab tab tab tab>! Go to right margin
K:<awp><oa-K rtn oa-F>P! Calculate page numbers and find page
(Used by sa-#)
------------------------
Make Title Page: (sa-T)
------------------------
T:<awp : { Vars Used : A }
zoom : oa-Z insert : oa-1 { Initialize cursor state at top of text }
oa-O print "PN" : rtn print "1" : rtn esc up oa-1
oa-O print "LM" : rtn print "1" : rtn print "RM" : rtn print "1" : rtn
print "TM" : rtn print "0" : rtn print "BM" : rtn print "2" : rtn
print "CI" : rtn print "10" : rtn print "UJ" : rtn print "LI" : rtn
print "6" : rtn print "SS" : rtn print "NP" : rtn esc oa-1
{ Insert default page settings at the beginning of text }
A = 0 : begin : { Put 33 blank lines at the beginning }
rtn A = A + 1 :
if A < 33 then rpt : else :
oa-O print "CN" : rtn esc sa-M : oa-O print "UJ" : rtn esc
{ Insert 'Centered', 'Marker 254', and 'Unjustified codes }
A = 0 : begin : { Insert 32 blank lines }
rtn A = A + 1 :
if A < 32 then rpt : else :
oa-1 oa-O print "TM" : rtn print "0" : rtn print "BM" : rtn
print "0" : rtn esc
{ Set top and bottom margins (of first page) to 0 }
A = 0 : oa-E
msg 'Enter only an asterisk (*) to quit' : begin :
sa-G : rtn rtn up input : { Get a line of input }
left K = peek 4341 :
if K = 170 then { '*' was entered, end the macro }
msg 'Do not use the insert cursor in the title page area. Press a key... ' :
key : msg '' : oa-D rtn stop :
else : if A = 0 then { Delete a blank line from bottom half }
oa-1 down down down oa-D rtn A = 1 : rpt :
else : A = 0 : down down down oa-D rtn oa-1 { Delete a line for top }
rpt>! Make a title page
G:<awp><oa-F>M254<rtn>! Goto marker 254 (set with sa-M)
(Used by sa-T and sa-#)
M:<awp><oa-O>SM<rtn>254<rtn esc>! Set marker 254 (Used by sa-T and sa-#)