| vfxFind Macro |
VFXFIND.TXT
Documenting [vfxFind] macro
and example <vfx> lookup tool for VDE.DOC
revised Sep 2007
for VDE.DOC version 1.95 (Aug 2007)
The VDE.DOC lookup list is updated.
The [vfxFind] macro and documentation are updated.
John Woodruff
desuetud@mail.onr.com
============================== INTRODUCTION ==============================
The [vfxFind] macro uses a list of long search strings, the "<vfx> section,"
as an index for finding matching strings (unique topics, rather than words
or short phrases as in a standard index) in the reference file to which the
<vfx> section is appended. The <vfx> section below is a working example.
The [vfxFind] macro doesn't change the file, which can therefore be set
read-only by the OS, opened in VDE /R mode, or set read-only using ^KO.
|
Go back to:
Macro Viewer
Mostly VDE
========================= SETTING UP THE SYSTEM ==========================
The following [vfxList] macro was used in constructing the <vfx> section at
the end of this file:
[F01]<Esc >[vfxList]<QN>^QS^KB^X^KK^KW+vfx.t[Enter]
This macro blocks the current line in the main file and adds that line to
file VFX.T. The concept is simply to go down through any text file, running
[vfxList] at each significant "heading" line. (VDE.DOC uses information-rich
heading lines, whence the [vfxFind] idea.) Using complete lines copied
verbatim from the reference text produces a "folded" version of the text
with as many exposed edges (lookup lines) as needed. If some key topics
aren't represented, you can extract additional lines (they need not be
paragraph headings).
Then, to create a <vfx> index, go to the end of the main file, type in the
<vfx> identifier, then on the next line use ^KR to import file VFX.T. Note
that the lines listed in the <vfx> section need not be in the same order as
they appear in the main text, and the lines can appear more than once (for
example, names might be sorted both by first and last name).
When first run from a blank line to initialize, the [vfxFind] macro finds
the top of the <vfx> section by searching backwards from the end of the file
for the "<vfx>" identifier. Therefore,"<vfx>" itself should not be used
within the <vfx> section except than as an ID, and the <vfx> section must
follow (be appended to) the main text.
Case-sensitivity update:
The [vfxFind] macro's search commands will work most precisely if the search
is case-sensitive. In this <vfx> section for VDE.DOC, all the lookup lines
have at least one capital letter. VDE's new "Adaptive" search mode is
well-suited for this situation.
Quoting from Eric Meyer's VDE195.NEW,
* Find/replace (^QF/^QA) can now handle search string case in a new
"Adaptive" mode, selected under Options in VINST: it treats search
strings entered in lowercase as case-insensitive, and those with any
capital letters as case-sensitive.
This simplifies installing [vfxFind] by eliminating the need to use a
specifically case-sensitive version of the macro.
Compilable single-line [vfxFind]:
[F01]<Esc >[vfxFind]<QN>^QS[Esc]=^MV[Esc]-F[Esc](1)[Esc]<!>^KB^QD^KK^QF^[[Enter]g[Enter]^OE[Esc]!][Esc]F[Esc]$V^QC^QF^R[Enter]b[Enter][K5][Esc]!][Esc]V[Esc](0)[Esc]$$^QC^QF<vfx>[Enter]b[Enter]^OE
[vfxFind] with comments:
[F01]<Esc >[vfxFind]<QN>
^QS
[Esc]=^MV ;initialize if on a blank line
[Esc]-F ;decrement counter, go to label F if zero
[Esc](1) ;set counter = 1
[Esc]<!> ;skip control characters and spaces
^KB^QD^KK ;block rest of line as search string
^QF^[[Enter]g[Enter] ;search globally (Adaptive or Case-sensitive)
^OE ;put found text at top of window or screen
[Esc]!] ;end
[Esc]F ;return to search string line in <vfx> section
[Esc]$V ;trap string not found error
^QC ;cursor to end of file
^QF^R[Enter]b[Enter] ;search backwards for previous string
[K5] ;center found text vertically
[Esc]!] ;end
[Esc]V
[Esc](0) ;set counter = 0
[Esc]$$
^QC ;cursor to end of file
^QF<vfx>[Enter]b[Enter] ;search backwards for "<vfx>"
^OE ;put found text at top of window or screen
|
Go back to:
Top of page
Macro Viewer
Mostly VDE
========================== VFX SECTION EXAMPLE =========================== <vfx> * Here, as an example, is a vfx section for VDE.DOC. To use it, paste it at the end of VDE.DOC. * When you have just opened a file that has a vfx section, initialize the vfx feature by pressing the [vfxFind] key while the cursor is on a blank line. In VDE documentation files, for example, the top line is always blank, so press the [vfxFind] key as soon as the file displays. * In the vfx section, put the cursor anywhere on a line containing the subject or lookup term you need information about, then press [vfxFind] to find the corresponding line in the text. If the search finds a match before reaching the text you need, press Ctrl-L to continue looking. In VDE.DOC, there are a few instances where an all caps section heading is cross-referenced in the text; I've copied the first line following the heading to be the actual lookup line, to reach the text section rather than a cross-reference. * After browsing in the main text, press [vfxFind] again to return to the vfx section to start a new search. You can quit at any time, edit, or do any other operation. If you use ^QF or ^QA manually in the main text, this will change the search string generated by ^QF^R, which [vfxFind] uses to return the cursor to the previous search selection. If pressing [vfxFind] gives an unexpected result, just put the cursor on a blank line and press [vfxFind] to re-initialize. * So that the maximum number of lines can be viewed, [vfxFind] does not split the screen (AltW) to view the text and index simultaneously. However, if you split the screen, [vfxFind] will function within one window. This could be useful for locating and copying selected material to another file. * To save time accessing the index, simply move the vfx section ID down to where you'd prefer [vfxFind] to initialize, for example below this verbose documentation. * Taking that idea a step further, you could insert the vfx section ID at multiple stops: for example, just above a short list of most-used lookups at the bottom, then higher to include the complete index. The IDs would be in effect permanent placemarks, reached backwards in turn by ^L. |
Go back to:
Top of page
Macro Viewer
Mostly VDE
======================= VFX LOOKUP LIST FOR VDE.DOC =======================
VDE.DOC
-------
Instructions for the VDE Editor:
version 1.95 (29 Aug 2007)
(c)1987-2007, E. Meyer
============================ 1. INTRODUCTION ==============================
====================== 2. QUICK-START INSTRUCTIONS ========================
========================= 3. FILES YOU CAN EDIT ===========================
LARGE FILES
[use the next line to go to the text -- jw]
VDE can only edit files up to a certain size; it was originally written
FILE MODES
[use the next line to go to the text -- jw]
VDE has different "file modes" for various file formats from simple DOS
/D mode is VDE's standard Document format, formatted into paragraphs with
/A mode (ASCII document) differs from /D only in that control codes
/U mode is for Unformatted documents stored with each paragraph as a
/T mode is a variation on /U, for Windows programs like Notepad using
/X mode is a further variation on /T, for files generated on Unix or
/N mode is for Nondocuments, simple line-by-line text like DOS batch
/C mode differs from /N only by establishing variable tabs instead, and
COMPATIBILITY
The remaining modes (/W,S,P,F,M,L) allow VDE to read or write files
WORDSTAR - /W mode supports all features of WS v.3-4 file format. /S
WORDPERFECT - /P mode reads and writes files in WP v.4 format. /F mode
MICROSOFT WORD - /M mode reads files in the format of DOS Word v.3-6,
LX MEMO (HP LX palmtop) - /L mode reads and writes files in the
NOTES
Formatted text files not originally created with VDE are likely to be
============================= 4. DOS SYNTAX ==============================
EXAMPLES
[use the next line to go to the text -- jw]
C> VDE
C> VDE SAMPLE.FIL
C> VDE B:\WORK\FILE1 MYDIR\FILE2 \FILE3 D:FILE4
C> VDE D:*.TXT
C> VDE *.DOC/
C> VDE MY.DOC[12] /W ;WS4.VDF
C> VDE B:\WORK\INTRO[help],INDEX/R
C> VDE /M66 SUMMARY, PROPOSAL.CH2, COMMENTS.ALL
C> VDE "C:\My Documents\Annual meeting notes.txt"/T[6]
============================= 5. BEYOND DOS ==============================
DESQVIEW
MICROSOFT WINDOWS
========================== 6. COMMAND SUMMARY =============================
SPECIAL KEYS
SPECIAL PC KEYS
MENUBAR CHOICES
COMMAND KEYS
I. CONTROL KEYS: press the ctrl-key combination shown.
II. FILE AND BLOCK COMMANDS: first press ^K, then the key shown.
III. QUICK COMMANDS: first press ^Q, then the key shown.
IV. ONSCREEN COMMANDS: first press ^O, then the key shown.
V. ALT-KEY COMMANDS: hold [Alt] and press the key shown.
VI. ESC-KEY COMMANDS: first press [Esc], then the key shown.
========================= 7. COMMAND REFERENCE ============================
AUTOFORMAT (^OM) - ^OM toggles AutoFormat on and off in a document. When on,
AUTONUMBER (^K#) - VDE can automatically number items for a list, outline,
AUTOSAVE (^KA) - VDE can automatically save any changes you've made to disk
BLOCK COMMANDS (^KB,^KK,^KH,^KZ,^KY,^KC,^KV,^KW; ^QB,^QK; ^KPB) - A block of
CLIPBOARD (^[,^]; Esc*b) - VDE is compatible with Windows copy/paste COLUMN
BLOCKS (^KN,^KI) - ^KN toggles column block mode on and off, and ^KI
CURSOR MOTION (Mouse,Arrows; ^F,A,C,R; ^QE,X,S,D; ^QR,C; ^QI,L,N,P; AltO) -
DATA FILES (AltU) - AltU allows you change various settings in VDE by Using
DELETE FILE (^KJ) - ^KJ simply deletes whatever disk file you specify.
DELETION ([BkSp],[Del],^[BkSp],^[Del],^G,^T,^Y; ^QY,^Q[BkSp],^QT) - ^G or
ENVELOPES (^KPA) - The Print command's "A"ddress option offers an easy way
FILE BROWSER (^KF,Esc*L) - The File Browser shows a directory listing and
FIND/REPLACE (^QF,^QA; ^L,^H) - ^QF is the command to Find a text string.
GRAPHICS/FOREIGN CHARACTERS (AltG) - Characters in the upper half of the
HEADER (^OQ) - The "header" at the top of the screen can be toggled on and
HYPHENATION (^OH,^P-) - ^OH toggles hyphenation on and off. VDE can't
INDENTATION (^OA,^OG,^OO) - Several commands produce automatic indentation in
INFORMATION (AltK,AltI) - The file/memory information command AltK displays a
INPUT DIRECTION (^I) - This command cycles from the normal state in which the
INSERTION (^V,[Ins],^[Ins],^_,^N,^\) - ^V or [Ins] toggles Insert mode
JUSTIFICATION (^OJ,^OW) - ^OJ controls right justification mode, cycling each
LINE SPACING (^OS,^OW) - ^OS toggles between single and double line spacing.
MARGINS (^OL,^OR,^OX,^OW,^OC,^OF) - ^OL and ^OR set the Left and Right
MATCHING TEXT (AltM,Esc*m) - The Match command can locate variations between
MENUBARS (^[Esc]) - Ctrl-Esc calls up the MenuBar. (LeftShift-Esc can also
MULTIPLE FILES (AltL;AltB,N;AltS,X,Q,Z;AltY,C,P) - VDE can edit up to 8 files
PAGINATION (^OP,^PL) - ^OP sets the Page length as a number of text lines
PLACE MARKERS (^KM,^KU;^QM) - Any number of temporary place markers can be
PRINT (^KP) - ^KP Prints the current file; "Wait" displays in the header,
PRINT PREVIEW (^OD) - Preview mode changes the display to show better how
PRINTER CODES (^P) - The ^P prefix is used to enter various codes in the
PRINTER DRIVERS (AltV,AltU) - Since many people use more than one kind of
PROPORTIONAL SPACING (^OK) - Like other editors that display in text mode,
PROTECTED MODE (^KO,/R) - When you want to view a file without accidentally
QUIT (^KQ,^KL) - You can quit a file with either of these commands; if it's
READ/IMPORT (^KR) - ^KR Reads in (imports) the contents of another disk file,
REFORMAT ([Enter],^B;Esc*S;^OY;^OB) - In documents, pressing [Enter] creates
RENAME/SAVE AS (^KE) - Many editors offer a "save as" function to save a copy
RULER LINE (^OT) - To help you align text properly, ^OT toggles display of a
RUN COMMAND/SHELL (AltR) - AltR lets you run DOS commands without leaving
SAVE (^KS,^KX,^KD; Esc*t) - ^KS simply Saves any changes you've made to the
SCREEN CONTROLS (^W,^Z; Alt-arrows; ^OE,^OZ) - VDE provides a number of
SCREEN SIZE (AltE,AltA) - The standard PC text screen is 25 lines of 80
SPELLING CHECK (AltH,AltJ; Esc*U) - For previously registered shareware users
TAB EXPANSION (^KT,^KPI) - VDE provides two ways to expand any hard tabs in
TABS ([Tab],Shift[Tab],^[Tab]; ^OV,^OI,^ON; ^PI,Alt[Tab]) - VDE has two tab
TIME/DATE (AltT,AltD) - VDE can read the system clock and insert the current
UNDELETE (^U) - The UNdelete function recovers recently deleted or overstruck
UPPER/LOWER CASE (^^; ^K",^K') - ^^ (Ctrl-caret or 6) reverses the case of
WINDOWING (AltW,AltF; ^[PgUp,PgDn]) - VDE can split the screen into dual
========================== 8. CREATING MACROS =============================
A. KEYSTROKES AND NOTATION
---------------------------- B. DEFINING MACROS -----------------------------
--------------------------- C. RECORDING MACROS -----------------------------
------------------------ D. STORING MACROS TO KEYS --------------------------
--------------------------- E. MACRO PROGRAMMING ----------------------------
Notes on END OF FILE
----------------------- F. EXAMPLES OF USEFUL MACROS ------------------------
SIMPLE MACRO EXAMPLES
1. At its simplest, a function key is a way to repeat keystrokes. Thus,
2. The macro repeat count is an easy way to repeat VDE commands. For
3. To view a file by scrolling slowly through it, use the macro:
4. This macro, with repeat count "*", would find all phrases in square
SIMPLE FUNCTION KEY EXAMPLES
1. This macro, which could be stored as No-repeat on a function key, re-
loads the current file, undoing all changes made since it was last saved:
2. A function key defined as ^QR ^N AltD ^OF would place the current date
at the top right of a letter. Many VDE users set up a function key to
3. Function keys can be used to create powerful new commands, for
example: ^D ^A ^KB ^F ^KK marks the current word as a block. (If you don't
4. Function keys can be used as an alternative to AltG for the entry of
graphics; just program them with the actual characters, entered via [Alt] +
MACRO PROGRAMMING EXAMPLES
1. This macro ("BofP" in EXAMPLES.VDF) moves to the start of the current
2. Moving to the start of the current sentence ("BofS") is a bit more
3. If you want to produce a "pure ASCII" file for software that can't
4. Here is a macro that eliminates unwanted blank lines from a file;
5. This macro ("CtrLn") moves the cursor to the center of the line, using
6. This macro ("WFreq") counts and reports how frequently the word at the
7. Many programming languages use nested sets of parentheses, like "{}"
8. This macro mimics WordStar's "ruler from text" feature. While you're
9. Here is a very basic macro ("HTML-") to strip out hypertext markup
10. This macro illustrates the use of segment-navigation tests. It makes
11. This macro program ("Sort") uses the Esc@ function (see SORTING
---------------------- G. ADDING FEATURES: MAIL MERGE -----------------------
========================== 9. MACRO REFERENCE =============================
AUTOEXEC MACRO - VINST can designate one function key definition "autoexec",
CHAINING OR CALLING (Esc&,&&) - Esc&, followed by a key name like "!F1", will
COUNTER VARIABLE (Esc(),+,-) - Esc(n) sets the counter value to "n". Esc+
DEFINE OR RECORD MACRO (^M,^M^M) - To define a macro, press ^M and enter
ERROR HANDLING (Esc$,Esc%) - Esc$ can specify a label where macro execution
FUNCTION KEYS ([F1]..[F12], EscA-Z,0-9) - Macros can be stored to function
FUNCTION KEY LABELS (^OU) - To help you remember the purposes of function
KEY DEFINITION FILES (AltU) - These files save function key definitions and
LABELS AND JUMPS (Esc0..Z,Esc!) - In a macro, Esc0..Z are simply labels
PAUSE OR USER INPUT (Esc;,Esc?,Esc:) - Esc; gives a brief pause before macro
PROMPT AUTOMATION (^F,^[,^R) - It's worth pointing out the usefulness of
SEGMENT NAVIGATION (Esc|,\,/,[,],.) - Three Esc commands, useful from the
SORTING (Esc@) - Esc@ is essentially a version of Esc< for entire strings,
TESTS AND LOOPS (Esc=,~,<,>) - Esc= and Esc~ perform tests on the character
TOGGLE CONTROL (Esc*) - Toggle (on/off) commands are problematic when used
VALUE ADJUSTMENT (Esc#) - It can be very useful for a macro to adjust a value
======================= 10. TECHNICAL INFORMATION =========================
ACCESSORY PROGRAMS - For academic and technical writing, the author has a
CTRL KEY (CAPS LOCK) - VDE's WordStar-style commands make extensive use of
DIRECTORIES - At any VDE filename prompt, you can always specify a path as
THE "VDE DIRECTORY": Sometimes other files associated with VDE need to
ERROR MESSAGES - These display briefly below the header:
KEYBOARD VARIANTS - Some non-US keyboards differ in the arrangement of
MEMORY - VDE requires a minimum of about 140k free RAM; the number and size
PROMPTS - At prompts for numeric or text input, like "Column:" or "Find
SEGMENTATION - Macros that assume that each text segment being edited is a
===============================[end VDE.DOC]=================================
|
Go back to:
Top of page
Macro Viewer
Mostly VDE