Fast Phrases with Alt+# Variables

by Kendall Callas

By now I hope you've discovered macros. They're fabulous productivity tools, allowing you to record frequently repeated text or actions.

Variables offer a way to store commonly repeated information. By using variables to store a few often repeated details, you can magnify the power of your macros and merges, and even speed up typing from the keyboard.

A typical law office, for example, would benefit by using variables to hold the user's name and phone extension, the firm's name, phone number, and address, attorney names and bar numbers, symbols, file or directory names, or common phrases such as "San Francisco, California 941", "Very truly yours", etc.

Like the 26 Alt+letter macros, there are ten Alt+number variables. They are retrieved with a simple keystroke: Hold down the Alt key, then press a number (0, 1, 2, 3, 4, 5, 6, 7, 8, or 9) from across the top of your keyboard (not the numeric keypad). Alt+1, Alt+2, Alt+3, etc., may be defined to hold various kinds of text.

If your office is like the law offices I've worked with, by investing a little effort in making it easy to retrieve common pieces of information, you can make a solid step toward increasing your office productivity.


Here is an elementary WordPerfect 5.0/5.1 macro I call MEMORY, which sets ten Alt+# variables:

{ASSIGN}1~Jennifer McKinley~
{ASSIGN}2~Secretary to William F. Johnson~
{ASSIGN}3~Very truly yours,~
{ASSIGN}4~WILLIAM F. JOHNSON (State Bar # 123456)~
{ASSIGN}5~William F. Johnson, Esq.~
{ASSIGN}6~(415) 987-6543 Ext. 238~
{ASSIGN}7~35th Floor, Mailstop 250~
{ASSIGN}8~Cal. Civ. Proc. Code ~
{ASSIGN}9~Interrogatory Number :{Enter}{Left}{Left}~

Here is the same macro for WordPerfect for DOS 6.0/6.1:

VAR1= "Jennifer McKinley"
VAR2= "Secretary to William F. Johnson"
VAR3= "Very truly yours,"
VAR4= "WILLIAM F. JOHNSON (State Bar Number 123456)"
VAR5= "William F. Johnson, Esq."
VAR6= "(415) 987-6543 Ext. 238"
VAR7= "35th Floor, Mailstop 250"
VAR8= "Cal. Civ. Proc. Code "
VAR9= "Interrogatory Number "

The information from these variables is easily accessed when typing by using a simple keystroke, for example, Alt+3 to type out the words "Very truly yours,". Macros and merge documents can also use the information with a simple programming statement, for example, VARIABLE(3). (Of course, this technique works with word-name variables as well, but only number variables can be used from the keyboard with an Alt+# keystroke.)


The problem with variables is that they evaporate at the end of each session. So the MEMORY macro needs to be setup to execute at the beginning of each session. Add the /M-macronameoption to your WordPerfect startup command to run the MEMORY macro automatically each time you start WordPerfect:
Alternatively, add this line to your AUTOEXEC.BAT file:
SET WP=/M-MEMORYMost obviously, this approach offers an easy extension to the limit of 26 Alt+letter macros. Alt+number variables provide an additional ten easy-access snippets of information. But variables are far more useful than that.

Depending on your strategy, you may wish to either standardize the set of variables, or let users customize them. By using this technique to create a permanent, standardized set of variables, your macros and merge documents can automatically load the users name, title, phone number, fax number, address, attorney name, bar number, etc. This is just a hint of the power of this technique.

Another worthwhile goal is to let each user customize a set of ten number variables with the phrases or snippets of information they need most. This requires each user to have their own MEMORY macro. If each user has their own macro directory (such as on stand-alone PCs), then simply place the MEMORY macro there. In a network situation, however, you'll need to place a MEMORY macro in each user's home directory and map a drive letter to that directory (say, drive H:) upon login. Then use /M-H:MEMORY as the startup option. Alternatively, if an environment variable, such as USER, is set to the user's login name, use a startup option like /M-F:\HOME\%USER%\MEMORY. (Another approach is to give each user a unique macro name or location, and change each users startup command to launch that macro, such as WP /M-LUCY or WP /M-F:\USER\LUCY\MEMORY.)


Variables are more limited than macros. Variables may contain only text (no actions) and store not more than 128 characters each in WordPerfect 5.0/5.1. In version 6.x, this limit expands to 255 characters.

In addition to text, however, keystroke codes such as arrows, Enter, Tab, and Indent may be easily assigned to variables in WordPerfect 5.0/5.1, but it becomes a bit tricky in later versions. (See my article in WordPerfect Magazine, August, 1995.)

This approach also works in WordPerfect for Windows, but requires a bit more effort because the number variables are not assigned by default to the Alt+# keys.

Copyright (C) 1997 by microCounsel, (415) 921-6850. All rights reserved.

[ Home Page | Articles List | Top of this article ]