home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
VDEMAC2.ZIP
/
VDEMACRO.DOC
< prev
next >
Wrap
Text File
|
1990-04-13
|
13KB
|
303 lines
============
VDEMACRO.LBR
============
Some Useful Macro Key Definitions for
Eric Meyer's Video Display Editor v2.6x
The macro key feature of Eric Meyer's VDE enormously extends the rangeáì
and power of this small, simple, and speedy word processor. This fileáì
discusses the permanently installed macros I use. Some of them may beáì
of use to you as they are, and you may want to adapt some of the ideasáì
to your own uses.
VDE262.VDK is the one I use routinely in my straight word processingáì
version of VDE. You can install it in a test copy of VDE to see howáì
these particular macros work. The macro key codes look like this whenáì
called up by VINST262:
MACRO KEYS: (00D6 bytes free)
<0><Q>F R E D H A I N E S^M^M733 north king's road apt 331^M
los angeles, california 90069^Mtelephone [213] 658-8664^M
<1><Q>^Q^S^X^[=^M]^S^V ^V^D^[![
<2>^[=^M0^V^I^V^B^G^[![^[0^X
<3>^[=^M0^T^B^N^[0^X
<4>^N^N^N^N^N^N^M^M^Mpage #^O^F^G^G@@@^E^E^E^E^E^E^E^E^C^C^C
<5>^N^N^N^N^N^N^M^M^M- # -^O^C^G^G^E^E^E^E^E^E^E^E^C^C^C
<6>^Qa^P^M^M ^P^M^M*^[^Qr
<7><Q>^P^[^P^I^P^K^P^[9
<8><Q>^[~ <^[0^^^[~ 0
Select <0-9> or <Z>ap; or <CR> to exit:
I've folded lines 1 and 9, but this is more or less what you'll see.
ESC-0 - LETTERHEAD
Macro ESC-0 types my letterhead to the screen - on the left side,áì
since I prefer a flush left style, but it could be modified to printáì
in the center or at the right without too much trouble. The <Q> ináì
angle brackets is added at the end of typing the macro in, when youáì
are asked to select <N> for "no repeat," or <Q> for quiet. There's noáì
particular reason to watch this happening, and <Q> is faster.
ESC-9 - BOLDFACE LETTERHEAD
ESC-9 goes back and make the letterhead boldface by adding CTRL-D's toáì
the beginning and end of each line.áì
<9><Q>^V^[~F<^P^D^Q^D^P^D^D^D^P^D^Q^D^P^D^D^P^D^Q^D^P^D^D^P^D^Q^D
^P^D^D
The code immediately after the ^V (to switch insert mode back on,áì
since VDE always switches insert off when it executes a macro), ^[~F<,áì
is the VDE code which causes the cursor to search backwards until itáì
reaches a capital F, and the rest of the line is more or less selfáì
explanatory. It embeds a ^D, issues a ^QD to skip to the end of theáì
line, embeds another ^D, and so forth. If your first name doesn'táì
begin with F you would have to substitute your own initial, of course,áì
and, if that is duplicated elsewhere in the letterhead, you would haveáì
to repeat the ^[~(initial)< code.
Another way to do this, if you want to use the letterhead only at theáì
top of your document, is to code the macro to go to the top of theáì
document with a ^QR, then search forward instead of backward for theáì
initial letter.
I use two separate macro keys partly because the text exceeds theáì
allowable limit of characters for a single macro key, and partlyáì
because I like to choose whether to make the letterhead boldface oráì
not.
In fact these macros are overly fancy - it's just as easy to keep aáì
file with the letterhead in it and read it in with a ^KR command - butáì
they do illustrate some features of VDE's macro facility. You canáì
keep a letterhead block file in any user area, because the ^KR commandáì
lets you specify the directory as well as the file name.
ESC-1 - MAKE PARAGRAPH REFORMABLE
ESC-1 replaces all hard carriage returns from the cursor position toáì
the end of the paragraph with soft carriage returns, allowingáì
reformatting with ^B.
<1><Q>^Q^S^X^[=^M]^S^V ^V^D^[![
The coded commands first return the cursor to the beginning of theáì
line, then drop it down one line. The special VDE macro code ^[=^M]áì
is a conditional jump to the end of the macro - quitting - if theáì
character under the cursor is a carriage return, as it would be if theáì
cursor were on the blank line at the end of a paragraph.
This macro treats paragraphs which aren't separated by a blank line asáì
a single paragraph. If you use an indented first line as theáì
indication of a paragraph, you have to add hard carriage returns whereáì
you want them before reforming.
ESC-2 AND ESC-3 - CHANGE PARAGRAPH FORM
ESC-2 and ESC-3 are companion pieces. I prefer to work in flush leftáì
block paragraph style with a blank line to denote the paragraph (likeáì
this document), but I often have to reformat a document in normaláì
indented paragraph style without blank lines between, particularlyáì
when preparing for publication - editors want indented paragraphs andáì
doublespacing.
If you put the cursor at the head of the text and do ESC-2, VDEáì
automatically convert the entire document to indented form. Toáì
doublespace, set doublespace with ^OS, go back to the top, and set upáì
a temporary macro (ESC-M) with nothing but ^B repeated with the *áì
command. ESC-3 reverses the process. First singlespace the document,áì
then run ESC-3 on it.
<2> ^[=^M0 ^V^I^V ^B^G ^[![ ^[0^X [spaces added for
clarity]
<3> ^[=^M0 ^T^B^N ^[0^X
The sequence ^[=^M0 is a conditional jump to label 0 if the characteráì
at the cursor is a carriage return. If it isn't a carriage return,áì
the code proceeds to the next sequence, ^V^I^V, which switches insertáì
mode on, does one tab (I have a tab fixed at column six for theáì
standard 5-column indentation), and switches insert off again -áì
necessary because this macro loops.
^B reformats the paragraph and the ^G deletes the blank line betweenáì
paragraphs. A ^G is safer than a ^Y here, because it accomplishes theáì
same purpose, removing a blank line, by deleting a single character,áì
the carriage return. If something goes awry and it tries to operateáì
on a non-blank line, you will lose only the first character, not theáì
whole line.
The ^[![ is a special case of the jump-to-label instruction whicháì
jumps to the beginning of the macro and runs it again. If the cursoráì
is then on a carriage return instead of the beginning of a paragraph,áì
the ^[=^M0 causes a jump to the ^[0 label and the ^X, which pushes theáì
cursor go down another line to search for the beginning of the nextáì
paragraph.
This macro, ESC-2, could actually be set up for either <N> no repeatáì
or <Q> quiet, since it loops of its own accord, but I prefer to watcháì
what's happening in case of anomalies in my formatting - you canáì
always abort a running macro by hitting ESC.
The ^[=^M0 and ^[0^X codes in ESC-3 work just as they do in ESC-2, andáì
the code between simply does a ^T to remove the indentation, a ^B toáì
reformat the paragraph, and a ^N to force a blank line before the nextáì
paragraph. This macro does not loop on its own, so you have toáì
specify at runtime how many times you want it to repeat.
ESC-4 AND ESC-5 - CUSTOM HEADERS
ESC-4 and ESC-5 are also companion pieces - both produce customáì
headers. If you put your cursor on the first line of page 2 and doáì
ESC-4, the macro will force 6 clear lines for a 1" top margin, thenáì
put a header on line 4 that looks like this:
@@@ page #
It then measures off a full page (of 58 lines on a 66-line page) andáì
positions the cursor at line 1 of page 2. Since I like to controláì
exactly where the page break comes I normally run this macro onlyáì
once, but specifying the * (continuous) command will put the header onáì
one four of every page of the document. Best not to do in quiet mode,áì
because the macro doesn't really know when it has run out of text andáì
will go on adding header lines endlessly.
I then number the pages by doing a repeated ^QF on the symbol # andáì
numbering the pages in sequence. I then do a temporary macro -áì
^QF@@@^MText - to replace the @@@ with whatever "Text" I choose. It'sáì
better to use a macro than a straight ^QF to do this, since "Text"áì
will be written in non-insert mode and will not displace the pageáì
number over on the right.
ESC-5 is very similar to ESC-4, but makes a less formal header that Iáì
use for short documents like personal letters, a simple - # - in theáì
center of line 4 of every page.
ESC-6 - REMOVE CARRIAGE RETURNS
ESC-6 is a straightforward sequence of ordinary VDE commands whicháì
changes all the hard carriage returns in a document into soft carriageáì
returns - space ^M.
<6>^Qa^P^M^M ^P^M^M*^[^Qr
The code gives the ^QA command to search all instances of ^M andáì
replace them with space-^M, then answers the prompt for "how manyáì
times?" with *, and then returns to the top of the document.
ESC-7 - SET LEFT MARGIN
This macro is the one I use the most. I usually run SLM (Set Leftáì
Margin) before invoking VDE to set a left margin on my Comrex CR-IIáì
(Diablo 1610 compatible) daisywheel printer, but inevitably there areáì
times when I forget to do so. Doing ESC-7 on the top line of the fileáì
inserts into it the printer's code for setting a left margin, ESC TABáì
nnH ESC 9, where nn is the ascii equivalent of the left margin columnáì
expressed in hex.
In this case I use ^K = 11 decimal = 0B hex, which starts printing ináì
column 11, leaving a 10-column, 1" left margin. This is the margin Iáì
use most frequently, but it is easy enough to vary by overwriting theáì
^K with another ascii code, ^F for a 5-column, 1/2" margin, foráì
example.
<7><Q>^P^[^P^I^P^K^P^[9
The ^P's in the command line are there to embed the following controláì
code in the file. Making it quiet with <Q> makes it marginallyáì
faster. What actually appears on your terminal's screen looksáì
something like this:
^[ ^K^[9
All characters but the 9 are in half-intensity highlight since theyáì
are embedded control codes. The tab doesn't appear at all, except asáì
the actual space of a default tab.
ESC-8 - REVERSE CASE OF WORD
This macro reverses the case of single word.
<8><Q>^[~ <^[0^^^[~ 0
The code ^[~ < moves the cursor to the left until it hits a space.áì
The code ^[0 is a label. The ^^ is the VDE command to reverse theáì
case of a character (that's CTRL-^). The code ^[~ 0 is a conditionaláì
jump back to the label - as long as the character at the cursor is notáì
a space, the macro will loop back to the label and do another ^^.áì
When it hits the space at the end of the word the macro quits.
Note that the first code, ^[~ <, moves the cursor left until it findsáì
the space before the word, which means that the cursor can be anywhereáì
in the word when you issue the command, and the macro will stilláì
reverse the case on every character in the word.
MACRO SETS
It's conceivable that you would want to have more than one set ofáì
macro keys for use with different applications. VDE is so small thatáì
it isn't a big problem to keep several copies of it under differentáì
names, at least on a hard disk system, but the fact that the macro keyáì
buffer is exactly three records long makes it possible to record,áì
store, and load the macro keys separately if you are running ZCPR3.
Install a set of macro keys with VINST262. Then use DDT or any otheráì
debugger on VDE.COM. Use the M command to move the three recordsáì
containing the key definitions to the base of the TPA:
-m0280,03ff,0100
-g0
SAVE 3 MACRO1.SET R to make a three-record file MACRO1.SET. Then loadáì
and run it with a multiple command line:
get 100 a0:vde.com;get 280 a0:macro1.set;go
This concept can be broadened to load entirely different front ends onáì
VDE. Since all customization of VDE - options, terminal, printer, andáì
macro keys - is in the first three memory pages of the program, youáì
can save, store, and reload as many different versions as you like asáì
three-page front ends. To load and run:
get 100 a0:vde.com;get 100 a0:vdevers1;go
TEMPORARY MACROS
You can of course override permanently installed macros by making up aáì
temporary macro and installing it on a macro key with the ESC-Káì
command. To clear the temporary macro keys and restore theáì
permanently installed ones, just exit from VDE and reload it.
Fred Haines
Glendale Littera RCPM/QBBS
Abel Iwaz, sysop
[818] 956-6164 [PC Pursuit]