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.
I've packed the macros here into a ZIP file.
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, removing any running total from a previous invocation.
KILRUN, invoked from the starting position, removes the running totals.
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 while in the macro edit screen.
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.