HOME

WELCOME, MACROMANIACS!

Hi, my name is Norma Chase and I am addicted to macro writing. And God help anybody who tries to take my WordPerfect 5.1 away from me. I'll give it up when they pry it out of my cold, dead fingers.

I am assuming that most people currently interested in 5.1 macros are very knowledgable about them, so I won't get into lengthy explanations of code.

This site includes macros for WP 5.1 and for Office Editor, a macro editing utility which was part of the old Office Shell and which is now freeware.

This is a humble beginning, and I will be adding more goodies as time permits. Future topics will include (1) persuading ALT- key combinations to do double and occasionally triple duty, (2) macros that edit macros (subroutine generator will be included), (3) macros that edit macros that edit macros, (4) creating variables while you are in the macro edit screen, (5) all kinds of 5.1 stuff as I think of it.

If you'd like to drop me a line, my home page includes an e- mail link. The link back to this page is through the bio page, which you will reach if you click on the bio icon by my name on the home page.

And now, some macros:

Math Macros

These macros let you use the normal text editing screen as a math scratchpad. QD lets you type a list of numbers along the left margin and then compute their sum. Each number must have two decimal places. You can have text after the numbers. You move the cursor back up to the left margin position on top of the first number. QD reads each number. When it gets to a blank line, it stops, executes a hard return, and puts the total on the screen at the left margin.

QDRUN does the same thing but puts a running total at the end of each line. KILRUN, invoked from the starting position, removes the running totals.

Line Surgery

RV is a variable recorder; it captures keystrokes and commands and puts them into a variable. It is most useful when you want to do repetitive line surgery. For example, I might have a list of names that are in a Chase, Norma format and want to convert them to first name first. I turn on Reveal Codes so I will know where the cursor is, do what I need to do with the text, go to the end of the line, and press the right arrow to take me to the beginning of the next line. I then press Alt-Home to end recording. Reveal Codes is turned off if it is on. EV is then activated (it can also be invoked independently) and asks me whether I want to run the variable a specified number of times, run it recursively, or run till a blank line is reached. If I press anything but a 1, 2, or 3, EV graciously aborts. EV will also run in the macro edit screen, but will not offer the option of stopping at the first blank line.

PERMIT, if chained or nested to an ALT-key combination, lets you put the contents of a variable containing commands into a macro.

System Information

What KTON does is give you the numerical equivalent of either the character or the code on which the cursor is resting or the character or code to the left of the cursor. It is the only macro in which I managed, without contrivance, to get four tildes in a row, with no two of them closing the same command. Don't know if that's a record. QVAR and QVARSIMP let you quickly determine the state of any user or system variable. QVARSIMP works during macro editing. I have them both chained to an ALT-key combo.

Array Emulation

An array, for those of you with no exposure to other programming languages, is a tool for creating the same set of variables, with the same variable names, for multiple similar transactions. The variable names have numerical subscripts. WP does not have an array function, and weird things happen when you try to mix text and numbers in variable names. The solution I found was to use letters instead of numbers. If my variables are "gross" and "net", array subroutines will make them agross and anet, then bgross and bnet, and so on.

I use arrays when I want to give WP a list of tasks to perform, with multiple variables per task. For example, I can type a list on my screen consisting of two words per line: the name of a primary document and the name of a data file. (I use single-record data files, although I can create a file that consolidates them when I need to.) The macro reads each line, and, for each pair, creates the document, prints it, appends it to a log file for the client, and clears the screen.

ARAZE uses sample text and tells you what documents it would create. The subroutine as written has an upper limit of 185 sets of variables.

EDM Macros

MAC2DOC converts any WPM or EDM macro to a parallel WPM macro that, when played back in WP, generates a text version of the macro. It offers the option of bolding codes, essential if you run MAC2DOC on itself. If you just want to watch what it does, you can run it as is on any macro; it will terminate unless it finds a directory called \mt and an empty macro called VESSEL.WPM on that directory. If you are running it on a WPM macro, you can save it manually to a different directory or under a different file name. Transplanting EDM code into a WPM macro is trickier and requires renaming files. If you want to save the results automatically, create the directory and the empty macro. The macro still lets you decide whether to overwrite an existing parallel macro. You would play back the text-creating macro in WP by putting the \mt\ pathname before the macro name (or writing a small macro that does this for you). If your code lines are long, you may need to reformat a little in WP to avoid mid-command line breaks.

CHUNK.EDM is what you use when you find yourself up against mysterious macro size limits in WP. You go back to your text- creating macro in ED and run CHUNK on it. It breaks the macro into 300 line chunks, saved as 1[name].WPM, 2[name].WPM, et cetera. You come back to WP and run \mt\1[name], which chains the others.

{QUIT}