home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR8
/
WP60DOSM.ZIP
/
CONCEPTS.ASC
next >
Wrap
Text File
|
1993-09-22
|
31KB
|
826 lines
C O N T E N T S
WordPerfect Macros Manual
─────────────────────────────────────────────────────────────────
Converting 5.1 Macros
Recording, Editing, and Compiling 6.0 Macros
Variables and Arrays
Loops and Subroutines
Operators
List of Shipping Macros
Appendices
Glossary
Converting 5.1 Macros to 6.0
─────────────────────────────────────────────────────────────────
Macros are converted from 5.1 to 6.0 with the conversion utility
MCV.EXE. This utility is executed from a DOS prompt by typing
MCV. You can either include a complete command line using the
syntax below, or allow the utility to prompt you for the source
and destination of the macros to convert. If you want to cancel
the conversion at any point, press ESC, Cancel, Exit, or
Ctrl+Break. The conversion will quit after converting the
current file.
Syntax: MCV Options Source Destination
Parameters: Options (optional)
Option Description
═════════════════════════════════════════════════
/b If a 5.1 macro is designed to
execute only when block is on,
conversion with this option assumes
that the macro will still only be
executed when block is on.
/h Displays the conversion utility
help screen giving the syntax and
list of start-up options.
/l-logfile Specifies the name of a file to
which all on-screen messages
associated with the conversion are
saved.
/o Allows the utility to automatically
replace the destination file if it
already exists. The utility will
not prompt for replacement.
/q Removes quotation marks from text
strings.
/s Conversion uses 6.0 macro command
abbreviations.
═════════════════════════════════════════════════
Source
The name of a macro, or wildcard characters
representing a group of macros, to convert.
Destination
The path and/or name of the converted macro.
──── ────
Recording, Editing and Compiling 6.0 Macros
─────────────────────────────────────────────────────────────────
Creating WordPerfect 6.0 macros is a process of recording,
editing and compiling macro commands. Each part of the process
will be described in this section.
Recording Macros
There are several ways to record macros. You can let WordPerfect
record commands for you, or you can type in the appropriate
commands yourself. You can also use these two methods in
combination.
To record a macro,
1 Choose Macro from the Tools menu, then choose Record.
Alternate Method: Or Press Ctrl+F10
2 Type a filename for the macro. WordPerfect assigns a
.WPM extension to the filename for you.
3 Choose OK to begin recording the macro.
The message "Recording Macro" displays in the lower left corner
of the document window throughout the recording process.
WordPerfect records commands from the keyboard (including any
text you type) as well as selections made with the mouse.
However, while a macro is recording, the mouse cannot be used to
position the cursor in the document window. If you want to
position the cursor in the document window, you must use the
keyboard.
To stop recording,
4 Choose Macro from the Tools menu, then choose Stop.
Alternate Method: Or Press Ctrl+F10
You can record programming commands such as ASSIGN and system
variables such as ?Name by selecting them from the Macro Control
dialog box.
To record Programming Commands or System Variables,
1 Press Ctrl+PgUp, then select Macro Commands.
Alternate Method: Or Press Ctrl+PgUp, Ctrl+PgUp
2 Highlight the command or variable to record, then
press Enter and fill in the appropriate parameters.
3 Choose Insert.
Editing A Macro
Since WordPerfect 6.0 macros do not need a macro editor, they can
be opened into, and edited from, any document window.
To open a macro,
1 Choose Open from the File menu
Alternate Method: Or Press Shift+F10
2 Type the filename of a macro, including the .WPM
extension.
3 Choose OK
The macro is opened into the current document window. You can
type in new commands or edit existing ones. You can also record
Programming Commands or System Variables with the method
described in Recording Macros. If you want to record Product
Commands, such as Margin Top, you can switch to a recording mode.
To record while editing,
1 Press Ctrl+PgUp, then choose Macro Record Document.
2 Choose OK.
The message "Edit Macro: Press Shft+F3 to Record" will display in
the lower left corner of the document window. If you switch to
record, the recorded commands are inserted into your macro at the
cursor. You can switch between recording and editing as many
times as you want.
To stop editing,
4 Choose Exit from the File menu.
5 Choose Save and Exit.
Compiling a Macro
A macro compiler is used to compile or "translate" macros so that
WordPerfect can play them.
To compile a macro,
1 Save the macro.
or
2 Play the macro.
If you receive an error message during the compilation, you can
either edit the macro or save the macro. If you choose to save
the macro, the errors will still need to be corrected before it
will play. If you choose to edit the macro, the macro file opens
and your cursor is placed somewhere after the problem.
The compiler is a useful tool for troubleshooting macro problems.
However, it can only make a "best guess" as to what the macro is
actually designed to accomplish. As a result, errors given by
the compiler sometimes serve as direction to, rather than
specific identification of, the reported problem.
──── ────
Variables and Arrays
─────────────────────────────────────────────────────────────────
Variables
A variable represents a place in memory where data is stored. As
its name indicates, the data in a variable is changeable. Using
variables, you can calculate values and use text that may change
during the execution of a macro. WordPerfect uses two types of
variables: system variables and user-defined variables.
System Variables
System variables are variables that WordPerfect creates and
maintains. These variables contain information about the
current state of WordPerfect. You cannot change the names or
contents or these variables, but you can obtain and use their
contents in a macro. Some system variables contain values
corresponding to the enumerated types or numeric equivalents
of a product command. If you want to evaluate the variable
with programming commands such as IF or WHILE, the expression
can contain either the enumerated type or its numeric
equivalent. If you type the contents of the variable, the
Type command will only type the numeric equivalent. For a
list and description of all system variables provided by
WordPerfect, see the System Variables Index.
User-defined Variables
User-defined variables are variables that you create and name,
and whose contents you determine. You can perform operations
on these variables to change their contents. There are three
types of user-defined variables: Local, Global, and
Persistent.
Variable Type Description
══════════════════════════════════════════════════════════════
═══
Local Available for use only in the current macro
or in FUNCTIONs or PROCEDUREs containing a
LOCAL command.
Global Global variables are available for use
anywhere in the current macro as well as in
FUNCTIONs or PROCEDUREs in the current
macro.
Persistent Persistent variables are available for use
in any macro, any FUNCTION or PROCEDURE, as
well as any merges executed in the current
session of WordPerfect.
══════════════════════════════════════════════════════════════
═══
You can specify the variable type using the programming
commands, LOCAL, GLOBAL, and PERSIST. See the Macro Commands
Index for information on these commands.
All user-defined variables can contain text or numbers. There
are a number of programming commands that assign variables.
See the Macro Commands Index for information on ASSIGN, CHAR,
FORNEXT, FOREACH, GETNUMBER, GETSTRING, GETNUMBER, and LOOK.
Arrays
An array is a collection of related information called elements.
Arrays are useful for organizing the information and assigning
consecutive variable names. Array elements can be lists,
categories, or any type of information you want contained in one
location.
For example, to create an array containing the days of the week,
you could use the ASSIGN command as follows:
ASSIGN (Day; {"Monday" ; "Tuesday" ; "Wednesday" ;
"Thursday" ; "Friday" ; "Saturday" ; "Sunday"})
When an ASSIGN command is constructed like this, "Day" becomes
the array name and each of the days within the braces ({}) are
elements of the array. "Monday" is the first element, "Tuesday"
is the second element, and so forth. The elements are in quotes
only because they are character expressions that may need to be
typed out later. Arrays can also contain numeric expressions and
measurement expressions. For more information on ASSIGN, see the
Macro Commands Index.
To use the information contained in each element, you must create
a variable by combining the array name with the appropriate
subscript. A subscript is a number enclosed in brackets ([]).
The number in the bracket should correspond to the position of
the element you want to use. For example, Since Thursday is the
fourth element, its subscript is [4]. Consequently, the variable
name used to access the word "Thursday" is Day[4]. This variable
could be used to type "Thursday" using the Type command as
follows:
Type(Day[4])
Arrays are also created by simply declaring the array name along
with a subscript and assigning the element contents as follows:
Day[1]="Monday"
Day[2]="Tuesday"
Day[3]="Wednesday"
...and so forth
──── ────
Loops and Subroutines
─────────────────────────────────────────────────────────────────
A loop is a series of commands that repeat a number of times.
Loops are created with programming commands and are useful in
macros if you want to perform a series of tasks but do not need
to supervise every step of the process. For example, you could
have a macro search for and delete every occurrence of a specific
word or create a certain number of labels. Loops are also useful
for obtaining information. For example, you could create a macro
to display a dialog box that prompts for mailing address
information. The dialog box would continue requesting
information for new addresses until the user clicks on a "Last
Address" button.
The following programming commands can be used to create loops.
See the Macro Commands Index for a complete description and
example of each command.
Command Combination Description
═════════════════════════════════════════════════════════════════
═
#4264#FORNEXT - #4242#ENDFOR: A set of commands repeats for a
specified number of times.
#4266#FOREACH - #4242#ENDFOR: A set of commands repeats for a
specified circumstance.
#4282#IF - #4246#ENDIF: A set of commands repeats if a
specified condition is
satisfied.
#4340#REPEAT - #4386#UNTIL: A set of commands repeats
until a condition has been
satisfied.
#4396#WHILE - #4250#ENDWHILE: A set of commands repeats only
while a specific condition
exists.
═════════════════════════════════════════════════════════════════
═
Subroutines
A subroutine is a set of commands you may want to execute several
times in a macro. Instead of entering the commands at several
locations in the macro, you can include them only once and direct
the macro to that location each time the commands are needed. A
subroutine is created with programming commands such as FUNCTION,
LABEL, and PROCEDURE. A macro is directed to a subroutine with
programming commands such as CALL, GO, ONERROR, ONCANCEL, and
ONNOTFOUND. See the Macro Commands Index for more information on
these commands.
Since there may be more than one subroutine in a macro, the name
associated with each one must be unique. The label name must be
entered in the command that directs execution to the subroutine,
for example GO(MyLabel). The label must match the name of the
FUNCTION, LABEL, or PROCEDURE to which execution is directed.
──── ────
Operators
─────────────────────────────────────────────────────────────────
WordPerfect supports the evaluation of expressions with several
operators. Consequently, some order of evaluation must be
followed. The operator precedence used by WordPerfect is similar
to the accepted precedence for mathematical operators in formal
programming languages.
The following table shows the order in which operators are
applied (operators of the same precedence are evaluated left to
right in the expression):
Order Operators
═════════════════════════════════════════════════
1 (), -(unary minus), +(unary plus), ~(bitwise
not), NOT(logical not)
2 *(multiply), /(divide), %(mod), DIV(integer
divide)
3 +(add), -(subtract)
4 <<(shift left) >>(shift right)
5 <(less than), <=(less than or equal to),
>(greater than), >=(greater than or equal to),
<>(not equal) =(equal)
6 &(bitwise and), |(bitwise or), ^(bitwise xor)
7 AND(logical and), XOR(logical xor)
8 OR(logical or)
═════════════════════════════════════════════════
You can override the operator precedence by placing parentheses
around the elements you want evaluated first. Elements inside
the parentheses are always evaluated before the elements outside.
If parentheses are nested, the innermost parentheses are
evaluated first.
──── ────
List of Shipping Macros
─────────────────────────────────────────────────────────────────
The following predefined WordPerfect macros can help you perform
several common tasks. All of the following macros except
ALLFONTS.WPM and LIBRARY.WPM are on the MACROS keyboard, and all
of them except EXITALL.WPM and LIBRARY.WPM are also on the MACROS
Button Bar (see Setup: Keyboard Layout and Button Bar for more
information). Although these macros are much easier to play from
the keyboard or Button Bar, the files listed below are included
so that you can modify them for your own needs.
ALLFONTS.WPM
This macro types the names of all fonts for the current
printer in their respective typefaces.
BULLET.WPM
This macro inserts a bullet character of your choice at the
beginning of the current paragraph or each paragraph in a
series of blocked paragraphs.
CALC.WPM
This macro displays a calculator that you can use for
mathematical calculations.
EDITCODE.WPM
This macro lets you easily edit codes. For example, in
Reveal Codes you can place the cursor on a graphics box
code and use this macro to go quickly to the graphics box
editor.
EXITALL.WPM
This macro returns you to the main editing screen from any
subscreen or dialog, such as the footnote editing screen.
GLOSSARY.WPM
This macro lets you create and expand glossary entries. A
glossary entry is an abbreviation such as ASAP (as soon as
possible).
INITCAPS.WPM
This macro capitalizes the first letter of the current
word.
LIBRARY.WPM
This macro contains a collection of functions and
procedures that are used by several of the other predefined
macros. Any macro that contains the command
USE("LIBRARY.WPM") can use the functions and procedures
defined in LIBRARY.WPM.
MEMO.WPM
This macro opens a menu that helps you format a memo,
letter, or fax cover sheet.
MOD_ATRB.WPM
This macro helps you modify font attributes.
NOTECVT.WPM
This macro opens a menu that lets you convert footnotes to
endnotes or endnotes to footnotes.
PLEADING.WPM
This macro opens a menu that helps you create a style for
pleading papers. It then inserts the style into your
document so that you can create a pleading paper.
SPACETAB.WPM
This macro opens a menu that helps you convert spaces to
tabs.
──── ────
Appendix A: Keystroke Numeric Equivalents
─────────────────────────────────────────────────────────────────
──
Keystroke Numeric
Equivalent
═════════════════════════════════════════════════════════════════
A 97
B 98
C 99
D 100
E 101
F 102
G 103
H 104
I 105
J 106
K 107
L 108
M 109
N 110
O 111
P 112
Q 113
R 114
S 115
T 116
U 117
V 118
W 119
X 120
Y 121
Z 122
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57
0 48
~ 126
` 96
- 45
= 61
! 33
@ 64
# 35
$ 36
% 37
^ 94
& 38
* 42
( 40
) 41
_ 95
+ 43
[ 91
[ 93
\ 92
{ 123
} 125
| 124
; 59
' 39
: 58
" 34
, 44
. 46
/ 47
< 60
> 62
? 63
F1 -8158
F2 -8159
F3 -7832
F4 -8157
F5 -8156
F6 -8155
F7 -8154
F8 -8153
F9 -8152
F10 -8151
F11 -8134
F12 -8133
ALT+F1 -8136
ALT+F2 -8135
ALT+F3 -8134
ALT+F4 -8133
ALT+F5 -8132
ALT+F6 -8131
ALT+F7 -8130
ALT+F8 -8129
ALT+F9 -8128
ALT+F10 -8127
ALT+F11 -6774
ALT+F12 -7675
CTRL+F1 -8124
CTRL+F2 -8123
CTRL+F3 -8122
CTRL+F4 -8121
CTRL+F5 -8120
CTRL+F6 -8119
CTRL+F7 -8118
CTRL+F8 -8117
CTRL+F9 -8116
CTRL+F10 -8115
CTRL+F11 -7759
CTRL+F12 -7163
SHIFT+F1 -8148
SHIFT+F2 -8147
SHIFT+F3 -8146
SHIFT+F4 -8145
SHIFT+F5 -8144
SHIFT+F6 -8143
SHIFT+F7 -8142
SHIFT+F8 -8141
SHIFT+F9 -8140
SHIFT+F10 -8139
SHIFT+F11 -8046
SHIFT+F12 -7149
Arrow Down -8166
Arrow Left -8167
Arrow Right -8168
Arrow Up -8169
Backspace -8112
Delete -8111
End -8107
Enter -8182
Escape -8160
Home -8184
Insert -8099
Page Down -8102
Page Up -8103
Tab -8183
═════════════════════════════════════════════════════════════════
──── ────
Appendix B: Key Names
─────────────────────────────────────────────────────────────────
──
Key Name
═════════════════════════════════════════════════════════════════
F1 CancelKey
F2 SearchDlg
F3 RepeatDlg
F4 Indent
F5 ListKey
F6 BoldKey
F7 ExitDlg
F8 UnderlineKey
F9 EndField
F10 FileSaveDlg
F11 RevealCodesKey
F12 BlockKey
ALT+F1 WritingToolsDlg
ALT+F2 ReplaceDlg
ALT+F3 RevealCodes
ALT+F4 BlockKey
ALT+F5 MarkTextDlg
ALT+F6 FlushRight
ALT+F7 ColumnsTablesDlg
ALT+F8 StyleDlg
ALT+F9 GraphicsDlg
ALT+F10 MacroPlayDlg
ALT+F11 TableEdit
ALT+F12 EnvelopeDlg
CTRL+F1 ShellDlg
CTRL+F2 SpellerDlg
CTRL+F3 ScreenDlg
CTRL+F4 MoveDlg
CTRL+F5 OutlineDlg
CTRL+F6 TabDecimal
CTRL+F7 NotesDlg
CTRL+F8 FontDlg
CTRL+F9 MergeSortDlg
CTRL+F10 MacroRecordDlg
CTRL+F11 TabDlg
CTRL+F12 Save
SHIFT+F1 SetupDlg
SHIFT+F2 SearchBackwardDlg
SHIFT+F3 SwitchKey
SHIFT+F4 IndentLeftRight
SHIFT+F5 DateDlg
SHIFT+F6 Center
SHIFT+F7 PrintDlg
SHIFT+F8 FormatDlg
SHIFT+F9 MergeCodesDlg
SHIFT+F10 FileRetrieveDlg
SHIFT+F11 WPCharDlg
SHIFT+F12
═════════════════════════════════════════════════════════════════
──── ────
Glossary
─────────────────────────────────────────────────────────────────
Active
An application, document window, or dialog box that is currently
in use.
Character Expression
A series of one or more WordPerfect characters enclosed in
quotation marks so the macro will recognize the characters as
text, not a variable.
Check Box
A check box turns an option on or off. If the check box contains
an X, the option is turned on. When text is selected in a
document, a shaded check box indicates that the option is on in
only part of the selected text. You can select more than one
check box in a group.
Codes
Formatting commands that make the computer and printer perform
various procedures. Codes are symbols that the computer and
printer understand. They can be edited in Reveal Codes.
Command Name
The word or string of words that begin a macro command. The
command name generally indicates which feature is involved in
executing a complete macro command.
Compile
Before a macro can play for the first time, it must be compiled.
When a macro is compiled, the program checks all the commands to
see if there are any errors and displays an error message if
there are. Only a macro with no errors can be played. Some
commands are designed to take effect during compilation while
others occur during the actual playing of the macro. Each time a
macro is edited and saved, it must re-compile before it can be
played. The program will automatically compile macros for you.
Conditional Statement
A statement created with macro programming commands such as IF
and WHILE. A conditional statement contains expressions such as
text, numbers, or variables to be evaluated. The flow or
direction of the macro can be affected by the "condition" of
these expressions at the time they are evaluated.
Dialog Box
Dialog boxes let you communicate with the WordPerfect program.
They display warnings and messages and they let you select
options and implement those options by choosing appropriate
command buttons. Dialog boxes must be closed before you can work
in the document window. When a dialog box option is unavailable
and cannot be used, it will appear dim.
Enumerated Type
The parameters for certain product commands can only accept
certain words. These words are referred to as "enumerated
types." Each enumerated type ends in an exclamation point and
has a numeric equivalent. For example, the product command
DisplayMode has one parameter and will only accept the words
Text!, Graphics!, or FullPage!
as entries in that parameter.
File
A document or other type of information that has been saved to a
computer disk under an identifying name.
File Format
The pattern in which a file is organized. Each application
creates documents in a unique format which is not accessible by
other applications unless those documents are converted to the
new application's format.
Filename
The name given to a file of information on disk. The name may be
up to eight characters long, with an optional three letter
extension, such as MYLETTER.ANN.
Macro Command
An instruction for WordPerfect to carry out. The instruction can
be in the form of a programming command or a product command.
Many macro commands must be used together with other macro
commands to be successful in giving a complete instruction.
Measurement Expression
A number representing a measurement which can, but does not have
to be followed by a unit of measurement character (", c, p, u).
If a unit of measurement character is not specified, the
program's current unit of measurement will be used. A
measurement expression should not be enclosed in quotation marks.
Memory
The temporary data storage area for a computer or printer.
Numeric Equivalent
The ASCII value of a character. Also, the number that can be
used in place of an enumerated type. For example, if you are
using the FootnoteNumberMethod product command and want to set
the numbering method parameter to Characters!, you can either use
Characters! (the enumerated type) or 5 (its numeric equivalent).
Numeric Expression
A number on which mathematical operations may be performed. A
numeric expression should not be enclosed in quotation marks.
Operator
A symbol or word that performs a function on one or more
expressions. For instance, operators compare expressions, link
words together, and perform mathematical functions on numbers.
Parameter
Represents which aspect of a feature the macro command is
manipulating. For instance, if you use the BoxCreate command to
create a graphics box, you can use a parameter value to specify
which type of graphics box to create.
Path
The location of a certain file or directory in a computer disk
drive or on a network. A full path includes the drive, root
directory, and any subdirectory names. Each name is separated by
a backslash (\). For example, C:\WP60\LETTERS would refer to the
LETTERS subdirectory in the WP60 directory on the C drive.
Relational Expression
An expression used to evaluate parameters that have only two
possible states: TRUE and FALSE. A relational expression should
not be enclosed in quotation marks.
Status Line
The line at the bottom of the WordPerfect window that lists the
current font and the position of your cursor.
Text Mode
A type of screen display in which WordPerfect does not show all
font attributes and formatting. When Text Mode is on, you cannot
see your document as it will print, but you may be able to work
more quickly because the computer does not take as much time
updating the appearance of the text.
Text Box
In a dialog box, the area in a dialog box where you type text or
where WordPerfect types text for you. The selection cursor must
be in the text box before you can begin to type. In a graphics
box, a type of graphics box that can be used for placing and
rotating text.
Text File
A file saved in ASCII (DOS). It contains text, spaces, and
returns, but no formatting codes.
Toggle
A feature or option that is turned on or off with the same
keystroke or command. If the feature or option is turned on or
off with a macro command, the command generally does not require
parameters.
Variable
A variable represents a place in memory where information is
stored. Variables can store character, numeric, measurement and
relational expressions. The value contained in a variable is
changeable. Variables are often used to keep track of words,
numbers, and measurements that change while the macro plays.
──── ────