| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
|Page updated Oct 26, 2006|
Updated code for the following five "obsolete" macro commands (thanks to David Wallis for this tip):
These system commands were used to get (and store) the current values for the currently selected printer and the margins at the current cursor location. Thus, you could program a macro to change printers (say, to your fax "printer") or change margins, and then restore things to the way they were prior to your changes.
For example, you could (1) store the current value of the left margin in a variable; (2) change the margin to some newly desired setting (such as 3"); and (3) reset the left margin after doing something that requires the new left margin setting.
Now that these system commands are obsolete (in WP9), you can use the normal product commands without a parameter in their place. In the example above, you would use:
Other commands that were changed can use these formats in place of the "<variable>:=?<command>"
If you have a macro that needs to play in WP8 (or earlier) as well as in later versions, and needs to obtain current margin values and then reset margins to the current values at some later point, you could use IfPlatform() to accommodate the two types of commands:
Note that separate IfPlatform segments would need to be constructed for each subsequent version of WordPerfect where the macro might be played. For parameters, use (_version10!) ... (_version11!) ... (_version13!) ... etc. See the bottom section of LABLCOPY as an example, which uses IfPlatform segments to store margin commands for WP6-WPX3.
With respect to ?CurrentPrinter, use somehting like this:
Finally, note that the normal command to set a new value can be used without a measurement as a parameter. When you do this the current value is returned instead, and can be stored in a variable as before.