Copy and Paste with Alt+# Variables

by Kendall Callas

Instead of retyping complex or lengthy text, a handy trick is to define it as a variable. By assigning text to a number variable (0, 1, 2, 3, etc.), it can be easily retrieved to any edit screen by holding down the Alt key and pressing the 1-digit number (Alt+0, Alt+1, Alt+2, Alt+3, etc.).

For example, suppose you are typing a document that requires frequent repetition of a long and complicated phrase. Instead of retyping it each time, define it as a variable. By assigning a phrase to variable 2, for example, the phrase is easily retrieved over and over with the keystroke Alt+2.

One advantage over a macro is that you don't need to retype the text to define it. A major disadvantage, though, is that unlike a macro a variable is forgotten when you exit WordPerfect.

To continue with our example, define the phrase as a variable this way:

  1. Highlight the phrase with Block/F12.
  2. Press Macro Commands/Ctrl+PgUp and you'll see the prompt "Variable:" at the bottom left of your screen. (For WordPerfect 6.x, now select Assign.)
  3. Type a 1-digit number (0, 1, 2, 3, 4, 5, 6, 7, 8, or 9). Finish by pressing Enter.

If you chose the number 2, for example, you have now assigned the phrase you highlighted to the keystroke Alt+2.

Try it out: Hold down the Alt key and press the number 2 (from the number keys across the top row of your keyboard). Anywhere you can type, you may instead use this Alt+# keystroke to retrieve the phrase you assigned to it -- at the regular edit screen (Doc 1 or Doc 2), other edit screens (such as Header, Footer, Footnote, Text Box, or caption), even editing a macro.

This technique has many uses. It's handy for repeating up to 10 phrases within or between documents, moving text into a macro, and using long filename paths (such as after you press F5 or Shift+F10).

Especially if you've already assigned all 26 Alt+letter macros, the ten Alt+# variables offer a useful adjunct.

Caveat: Variables are temporary. Only text may be assigned, any codes are lost. And variables may store no more than 128 characters in WordPerfect version 5.x. (In version 6.x, this limit expands to just over 1,000 characters.)

(This technique works in all versions of WordPerfect for DOS since version 5.0.)

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


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