Using macro commands to retrieve information

WordPerfect lets you create commands, such as MessageBox or GetString, that gather information for macros. You can use these types of commands, for example, to prompt the user to type in information. For information about the MessageBox command, see the PerfectScript Programming Macros Help in the PerfectScript macro command browser.

Using GetString, GetUnits, and GetNumber

You can use the GetString command to retrieve information, such as text or numbers, as text. The GetString command uses the following format:

  GetString (Var;Prompt Text; Title; MaxLength)   

The prompt text, title, and maximum parameter length are optional. You can use the GetUnits command if you want to provide WordPerfect with measurement information that can be used to move the cursor and set margins. If you want WordPerfect to use the information entered in a numeric expression (such as addition or subtraction), you can use the GetNumber command. Both the GetUnits and GetNumber commands are similar to the GetString command; however, they do not use maximum parameter length. The user can use any of the following abbreviations to represent units of measurement:

Unit of measurement
WP Units (1200 per inch)
Points (72 per inch)
i or “

If the user doesn’t type a unit of measurement with the number when prompted, WordPerfect uses WP Units as a default unit of measurement.

Using macro commands to retrieve information