home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
AT_WORLD
/
ATRIW10.MSA
/
PROTEXT_PROTEXT.TXT
< prev
next >
Wrap
Text File
|
1995-12-23
|
6KB
|
189 lines
Protext Macros
==========================================================================
As a followup to his Protext article in Issue 9 and as a response to
queries from readers, Mark Baines has included some more macros and
Promerge files for Protext users.
Users are also referred to the Protext Reference Manual for more details
on the Promerge language and the User Manual for details about macros.
Follow the instructions appended to each Promerge program or macro some of
which are contained in comments within the text.
Mark can be reached at msbaines@cix.compulink.co.uk if you have problems.
--------------------------------------------------------------------------
>A reader at the recent show asked me for the macro you wrote for "th". He
>couldn't get it to run as listed - any chance you could send it (and any
>others) for the reader disk?
Always a problem with listings in narrow columns. As listed the line
starting >sv is broken and and should continue with the 2 lines below. If
typed in that way won't work. The same goes for another similar line
beneath. No line must be broken (Protext can take infinitely long lines).
-----8<----------8<-----
>>>date.ps
>>>press Shift-Alt-D for enhanced date.
>sv ord="stndrdthththththththththththththththththstndrdthththththththst"
>sv day=sys_date[W1] num2=day*2 num1=num2-1
>sv endate=day+ord[&num1&:&num2&]+" "+sys_date[W2:3]
>>>sv endate=dayofweek(sys_date)+" "+endate
>ex key 326 "&endate&"
>sv date=endate
>ex svk d:\protext\protext.key
-----8<----------8<-----
Obviously the path at the end has to comply with the reader's path and
that token 326 isn't already used (shouldn't be by default).
File is typed in document mode. File saved with appropriate name. Used by
inserting into document with stored command '>in name'.
-----8<----------8<-----
>>> REVDATE
>>> Prints the date reversed
>sv rdate=sys_date[w3]+" "+sys_date[w2]+" "+sys_date[w1]
>ex key 300 "&rdate&" ; Alt D prints reversed date
-----8<----------8<-----
Some simple macros:
Just follow instructions.
Count words in a block
Assign to the Shift-Alt-C key.
Highlight a block of text, press the key assignment.
Enter in Edit Macros Expansion field:
^766^ctb^13^
Delete to end of text file
Place cursor at the place where you want the end of text to be, press key
assignment and all the following text to the end is deleted.
Enter in Edit Macros Expansion field:
^765^^538^^541^^541^^538^^744^
Bold line
Assign to Shift-Alt-B
Put cursor at start of line - press Shift-Alt-B
Enter in Edit Macros Expansion field:
^765^^687^^298^^523^
Italic line
Assign to Shift-Alt-I
Put cursor at start of line - press Shift-Alt-I
Enter in Edit Macros Expansion field:
^765^^687^^305^^523^
Underline paragraph
Assign to Shift-Alt-U
Put cursor at start of line - press Shift-Alt-U
Enter in Edit Macros Expansion field:
^765^^536^U^764^f !.^13^^536^U^754^
Swap two lines
Will swap the line the cursor is on with that below it.
Place cursor at start of first line. Press key assignment.
Enter in Edit Macros Expansion field:
^765^^687^^762^^753^^753^^13^^752^^525^^523^^752^^752^^545^
Indent paragraph and format
I have assigned this to the Alt-TAB key so that it not only adds an indent
tab but also formats the paragraph at the same time. This is a good
example of how existing commands can be added to or modified.
Enter in Edit Macros Expansion field:
^694^^720^
Quit Protext
I have assigned this to Alt-Q and simple quits Protext.
Enter in Edit Macros Expansion field:
^766^q^13^
Commands:
Type in document mode. Save file and use with command 'x name' to use it
where 'name' is the name of the file.
-----8<----------8<-----
@echo off
;Deletes all extraneous spaces:
r" " ' ' ag
r" " ' ' ag
r" " ' ' ag
r" " ' ' ag
r" " ' ' ag
echo on
-----8<----------8<-----
@echo off
; SORT 6th July 1992
; alpha sort of a marked block
; don't press enter after the last vertical line character
sb tempa
fsort tempa tempb -f1
|765||744||538||755||538||766|m tempb
del tempa
del tempb
echo on
|765|
-----8<----------8<-----
@echo off
; RSORT 6th July 1992
; reverse alpha sort of a marked block
; don't press enter after the last vertical line character
sb tempa
fsort tempa tempb -f1 -Z
|765||744||538||755||538||766|m tempb
del tempa
del tempb
echo on
|765|
-----8<----------8<-----
@echo off
; PSORT 6th July 1992
; personal name sort of a marked block
; don't press enter after the last vertical line character
sb tempa
fsort tempa tempb -f1 -P
|765||744||538||755||538||766|m tempb
del tempa
del tempb
echo on
|765|
-----8<----------8<-----
@echo off
; NSORT 6th July 1992
; numeric sort of a marked block
; don't press enter after the last vertical line character
sb tempa
fsort tempa tempb -f1 -N
|765||744||538||755||538||766|m tempb
del tempa
del tempb
echo on
|765|
-----8<----------8<-----
@echo off
; NRSORT 6th July 1992
; reverse numeric sort of a marked block
; don't press enter after the last vertical line character
sb tempa
fsort tempa tempb -f1 -D
|765||744||538||755||538||766|m tempb
del tempa
del tempb
echo on
|765|
-----8<----------8<-----
Slainte mhath
Mark
--
* Mark S Baines * FidoNet: 2:254/105.10@fidonet.org *
* * NeST: 90:102/107.0@nest.ftn *
* Inver, Scotland * TurboNet: 100:101/12.10@turbonet.ftn *
* 01862 871624 * AtariNet: 51:502/0.10@atarinet.ftn *