╔═════╦═════════════════════════════╦═════╗
║ ╔═╦═╝  Corel Corporation Limited  ╚═╦═╗ ║
╠═╬═╝                                 ╚═╬═╣
╠═╬═╗   Corel WP 6.2 Product Macros   ╔═╬═╣
║ ╚═╩═╗          01/01/97           ╔═╩═╝ ║
╚═════╩═════════════════════════════╩═════╝

Contents

Introduction

Macros are powerful tools for any Corel® WordPerfect™ 6.2 for DOS user. This manual contains basic information for beginning macro writers, important macro concepts for more advanced macro writers, and descriptions of each programming command and system variable.

What's in this Manual?

This manual is divided into five sections. A brief description of each section follows.

Practical Applications

This section contains four lessons that guide you through various aspects of creating macros. Each lesson builds upon the previous lesson, so we suggest that you complete them in order. The first lesson teaches basic macro creation skills and each subsequent lesson adds new skills and concepts. Upon completing lesson four, you will have created a fairly sophisticated macro.

Macro Language Concepts

This section describes the various components of programming commands and system variables. Rather than emphasizing macro skills, this section teaches numerous macro language concepts.

Programming Commands Reference

This section contains a description of each programming command. In addition to a description, this section includes syntax, parameters, related commands, and an example of each command.

System Variables Reference

This section contains a description of each system variable.

Appendices / Glossary / Index

Appendix A: Keystroke Numeric Equivalents lists the keystroke numeric equivalents for use in commands such as CHAR, LOOK, and PRESSKEY.

Appendix B: Key Names (PAUSEKEY) lists the name for each key on the keyboard. These key names are for use with the programming command PAUSEKEY.

Appendix C: Code Values for ?LeftCode and ?RightCode lists the values returned by the ?LeftCode and ?RightCode system variables.

Appendix D: List of Shipping Macros lists and describes the macros shipped with Corel WordPerfect. In addition to being useful, these macros are good examples to study as you learn to create your own.

Appendix E: Converting 5.1 Macros to 6.2 provides basic information and the syntax required to convert Corel WordPerfect 5.1 macros to Corel WordPerfect 6.2 for DOS macros.

The glossary defines terms specific to macros. If you encounter a term that is unfamiliar to you, refer to the glossary for a definition.

The index will aid you in finding the information you need.

Using this Manual

As you read through this manual, you should understand the following conventions and terms. They will help you locate and interpret the information you need.

Mouse Instructions

Unless otherwise noted, mouse actions refer to the left button. Most instructions in this manual refer to the mouse.

Keyboard Instructions

Although this manual is written with the mouse user in mind, some instructions involve the keyboard. When function keys are involved in the instruction, a plus sign between keys (such as Alt+F10) means that you must hold down the first key while pressing the second. A comma between keys (such as Home, Down Arrow) means to release the first key before you press the second.

Text you are asked to type is in bolded lettering.

Notes

Throughout this manual, but particularly in the lessons, you may see two kinds of notes: Important and Hint.

IMPORTANT: The important note gives critical information for completing a task or using macro features. When you see an important note, be sure to read it.

HINT: A hint note provides additional information about using a macro feature or a macro command.

README Files

Before you use this manual, we suggest you glance through the README files that apply to Corel WordPerfect 6.2 for DOS macros. Occasionally, changes are made to a program after a manual has been printed. README files generally contain information about those changes.

Practical Applications

Lesson 1: Creating and Editing a Letter Closing

Macros automate repetitive tasks and can help you quickly perform both simple and complex procedures. This lesson provides the foundation for the lessons that follow. Each subsequent lesson builds upon the simple macro you create here.

In this lesson, you will learn how to do the following:

Record a Macro

The Corel WordPerfect 6.2 macro language is a command-based language. This means that Corel WordPerfect records the results of keystrokes or mouse selections instead of recording the keystrokes themselves. For example, instead of recording each keystroke involved in changing your top margin to 2", Corel WordPerfect simply records the command MarginTop(2"). These commands are called product commands.

In this lesson, you will record product commands that create a letter closing.

To record a macro,

1 Choose Macro from the Tools menu, then choose Record.

2 Type closing in the Macro entry field.

3 Choose OK.

Notice that "Recording Macro" appears on the status line. Any text you type or formatting changes you make at this point are recorded.

4 Type the following letter closing:

Sincerely,

Sharon Simmons
Vice President, Marketing

5 Choose Macro from the Tools menu, then choose Stop to stop recording the macro.

If you did a Standard installation, a directory was created for your macros (for example, C:\COREL\WP62\MACROS). The Closing macro is now saved in this directory.

Compile and Play a Macro

Now you are ready to play the Closing macro. The first time you play or save a macro after creating or editing it, Corel WordPerfect compiles it for you. Compiling is a process of "translating" the macro into something Corel WordPerfect can execute. Compiling also detects errors in a macro.

To play your Closing macro,

1 Press Enter twice to move to a blank line.

2 Choose Macro from the Tools menu, then choose Play.

3 Type closing and choose OK.

The Closing macro plays, beginning at the cursor. This macro is now ready to play any time you want to close a letter.

IMPORTANT: If you receive an error message while the macro is compiling during a save, you can either choose Edit or Save Anyway. If you choose Save Anyway, the macro will be saved, but will not compile. If you are playing a macro and you choose Edit, the macro file opens and your cursor is placed somewhere after the error. For more information on errors, see Errors in Macros later in this lesson.

Edit a Macro

You may want to change a macro from time to time for various reasons. You may need to correct mistakes or change information. For example, suppose you are now the president of marketing and need to change your title in the Closing macro.

1 Choose Macro from the Tools menu, then choose Record.

2 Type closing in the Macro entry field.

3 Select the Edit Macro check box.

4 Choose OK.

The macro containing the recorded product commands is opened in a document window. Corel WordPerfect 6.2 macros do not require a macro editor. They are simply Corel WordPerfect documents that can be opened, edited, and even formatted in any of the nine Corel WordPerfect document windows.

DISPLAY(Off!)
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("Vice President, Marketing")

Each command recorded in this macro instructs Corel WordPerfect to do something. For example, "Type" is a command that tells Corel WordPerfect to type everything within the subsequent quotation marks.

5 Delete "Vice" in the last line of the macro.

HINT: Do not delete either of the quotation marks, but do delete the space after "Vice."

DISPLAY(Off!)
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")

Currently, the last thing the Closing macro does is type the word "Marketing." Suppose you now want the macro to move the cursor to the next line and type the company name. To accomplish this, you could type the macro commands into the macro yourself, but there is an easier way. You can switch to another screen and record additions to this macro.

Record Additional Commands

1 Move the cursor to the line below "Type("President, Marketing")."

Notice that "Edit Macro: Press Shft+F3 to Record" displays at the bottom of the screen.

2 Press Shift+F3

The first document window opens and the prompt "Record Macro: Press Shift+F3 to Edit" displays. Every selection you make or any text you type while in this document window is recorded in your Closing macro. You can switch between recording and editing as many times as you want.

3 Press Enter, then type the following:

Pembrook, Ltd.

4 Press Shift+F3 to return to edit mode.

Your macro should look like this:

DISPLAY(Off!)
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type ("Pembrook, Ltd.")

5 Choose Close from the File menu, then choose Yes to save the CLOSING.WPM file.

Play the Edited Macro

1 Choose Close from the File menu, then choose No to exit the document without saving it.

2 Choose Macro from the Tools menu, then choose Play.

The Play Macro dialog box appears.

3 Press Down Arrow (↓) to display a list of the four most recent macros.

4 With the closing macro highlighted, press Enter.

The new letter closing is now inserted into your document.

Recognize Errors in Macros

Earlier in this lesson you played CLOSING.WPM immediately after creating it. By playing the macro, you also automatically compiled it. Compiling a macro not only translates it into something Corel WordPerfect can execute, it also provides a useful tool for troubleshooting macro problems. If the compiler locates an error, a dialog box displays containing general information about the problem.

If you choose to edit the macro, your cursor will be placed somewhere after the error. However, the macro compiler can only guess 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.

Some of the most common macro errors include missing semi-colons between parameters, missing parentheses around parameters, missing quotation marks around character expressions, and macro commands spelled incorrectly.

What Next?

You have now finished lesson 1. To continue with the next lesson, choose Close from the File menu. Choose No to close the document without saving it.

Summary

In this lesson you learned the following:

Lesson 2: Product and Programming Commands

The Corel WordPerfect 6.2 macro language consists of two types of commands: product commands and programming commands. These commands let you use all the functionality of Corel WordPerfect and give you the power to use that functionality differently under different circumstances. Using both product and programming commands, you will expand the functionality of the letter closing macro you created in lesson 1.

In this lesson, you will learn how to do the following:

Expanding a Macro The letter closing you created in lesson 1 was a good way to automate a simple but repetitive task. However, macros can be designed to do much more. There are product commands for nearly every feature in Corel WordPerfect; this enables you to automate even complex and lengthy tasks.

Even though product commands give your macros access to nearly every feature of Corel WordPerfect, they do not provide for user interaction with the macro. Programming commands, on the other hand, are designed specifically for that purpose. Among other things, they enable you to store information in variables to be used later in a macro or redirect macro execution by responding to questions.

Using a combination of product and programming commands can expand the usefulness of simple macros.

Record Additional Product Commands You have already learned how to switch to a recording window while editing a macro. Now you will use that knowledge to record additional product commands that expand your letter closing macro into a macro designed to help you create a full letter.

Editing the Macro

1 Make sure you are at a blank screen.

2 Choose Macro from the Tools menu, then choose Record.

3 Type closing in the Macro entry field.

4 Select the Edit Macro check box.

5 Choose OK.

CLOSING.WPM will be displayed in the editing window.

6 Move your cursor to the end of the line containing "Display(Off!)."

7 Press Enter to insert a new line.

8 Press Shift+F3 to switch to the recording window.

While in this recording window you will record commands that center the page, insert the date, and insert four blank lines in preparation for typing an inside address.

Recording Additional Commands

1 Choose Page from the Layout menu.

2 Choose Center Current Page, then choose OK.

3 Choose Date from the Tools menu.

4 Choose Text.

5 Press Enter four times.

Now that you have recorded the additional commands, you can return to the editing window to see the results.

1 Press Shift+F3.

The macro should now look like this:

DISPLAY(Off!)
CenterCurrentPage(On!)
DateText
HardReturn
HardReturn
HardReturn
HardReturn

Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type("Pembrook, Ltd.")

Notice that the commands are recorded into the macro where the cursor is located. This is crucial to remember as you switch back and forth between editing and recording. It is also important to remember that any macro commands (product or programming) can be typed into the macro. However, unless you are sure of the correct syntax and values for each product command, it is easier to simply record them.

Now that the macro does more than type a letter closing, you can continue enhancing it with programming commands.

Inserting Programming Commands

Since the inside address, salutation, and content of letters usually vary, you can use programming commands to help you customize each letter you create.

The programming commands you will insert will determine the key to end a pause, then beep and prompt you to type the inside address. The macro will continue when you press the specified key.

Using the Command Inserter

The Macro Commands dialog box is helpful when adding programming commands to a macro. This dialog box, sometimes referred to as the Command Inserter, is the location from which you can insert programming commands and system variables. As you become more familiar with the commands, you can type them right into the macro.

1 Choose Macro from the Tools menu, then choose Control.

2 Choose Macro Commands.

Upon displaying the Macro Commands dialog box, the cursor is placed in a Search entry field ready for you to type in the command you need.

3 Type pauseset, then press Enter.

The cursor should now be in the Edit entry field ready for you to provide the parameters for the command. This command is expecting the name of the key to end a pause. Enter is usually the key that ends a pause, but since you need to type more than one line of text, a key other than Enter needs to signal the macro to continue.

4 Type EndFieldKey between the parentheses, then choose Insert.

The command PAUSESET(EndFieldKey) is inserted into your macro at the cursor. EndFieldKey is just one of many product commands PAUSESET accepts to set a pause key. Many keys on the keyboard have a corresponding product command, and in this case, EndFieldKey is the same as pressing F9.

In a moment, you will insert a command that contains a prompt. Since the prompt will display at the bottom of the screen, it would be nice to include a BEEP command to remind you that the macro is waiting for a response. Since BEEP requires no parameters, you can easily insert this into the macro by typing it.

1 On the blank line after PAUSESET(EndFieldKey), type BEEP.

2 Press Enter to move to a new line.

You are now ready to insert the command that will display a prompt and pause the macro while you type an inside address.

3 Press Ctrl+PgUp twice to display the Macro Commands dialog box.

4 Type input in the Search entry field, then press Enter.

5 Type the following between the parentheses in the Edit entry field:

"Type inside address, then press F9"

HINT: Be sure to include the quotation marks.

6 Choose Insert.

The macro should look like this:

DISPLAY(Off!)
CenterCurrentPage(On!)
DateText
HardReturn
HardReturn
HardReturn
HardReturn
PAUSESET(EndFieldKey)
BEEP
INPUT("Type inside address, then press F9")
Type("Sincerely,")

HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type("Pembrook, Ltd.")

Now that the macro is programmed to pause while you type the inside address, you can program it to pause while you type the recipient's name. This involves recording more product commands and inserting two of the programming commands you just used.

1 Delete the blank line inserted by the INPUT command.

2 Press Shift+F3 to switch to the recording window.

3 Press Enter twice to create two blank lines between the inside address and the salutation.

4 Type Dear in the recording window, then press the spacebar.

5 Press Shift+F3 to switch to the editing window.

The macro can now be programmed to pause while you type the recipient's name. You will want to use BEEP and INPUT like you did earlier in the macro. You won't need to use PAUSESET again; one occurrence of the command sets the pause key for the entire macro.

6 Move to the end of the Type command you just recorded, then press Enter to move to a new line.

7 On the blank line you just inserted, type BEEP.

8 Press Enter to move to a new line.

9 Press Ctrl+PgUp twice.

10 Type input in the Search entry field, then press Enter.

11 Type the following between the parentheses in the Edit entry field:

"Type recipient's name, then press F9"

HINT: Be sure to include the quotation marks.

12 Choose Insert.

Completing the Macro

Finally, the macro should be programmed to pause while you type the body of the letter.

1 Press Shift+F3 to switch to the recording window.

2 Type a colon (:) to end the salutation.

3 Press Enter twice to create two blank lines between the salutation and the body of the letter.

4 Press Shift+F3 to switch to the editing window.

5 Type BEEP, then press Enter.

6 Press Ctrl+PgUp twice to display the Macro Commands dialog box.

7 Type input in the Search entry field, then press Enter.

8 Type the following between the parentheses in the Edit entry field:

"Type the letter, then press F9"

HINT: Be sure to include the quotation marks.

9 Choose Insert.

10 Press Shift+F3 to switch to the recording window.

11 Press Enter twice to add a blank line between the end of the letter and the letter closing.

12 Press Shift+F3 to return to the editing window.

If the macro contains any blank lines, you can delete them. The completed macro should look like this:

DISPLAY(Off!)
CenterCurrentPage(On!)
DateText
HardReturn
HardReturn
HardReturn
HardReturn
PAUSESET(EndFieldKey)
BEEP
INPUT("Type inside address, then press F9")
HardReturn
HardReturn
Type("Dear ")
BEEP
INPUT("Type recipient's name, then press F9")
Type(":")
HardReturn
HardReturn
BEEP
INPUT("Type the letter, then press F9")
HardReturn
HardReturn
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type("Pembrook, Ltd.")

Since CLOSING.WPM now does much more than simply type a letter closing, you will want to give it a new name. Let's name this macro LETTER.WPM.

1 Choose Save As from the File menu.

2 Change closing.wpm to letter.wpm in the Filename entry field. Make sure the path specified is the correct location for your macros.

3 Choose OK.

You still have the original CLOSING.WPM macro, but now you have also saved your additions in a macro called LETTER.WPM. This macro is now programmed to help you quickly and easily create letters.

What Next?

You have now finished lesson 2. To continue to lesson 3, choose Close from the File menu. You will still have one document window open. If you want to close it, choose Close from the File menu, then choose No to close without saving.

Summary

In this lesson you learned the following:

Lesson 3: Variables and Subroutines

One of the most common uses of macros is to automatically make customized documents. You can do this using variables that store information and programming commands that direct macro execution.

In this lesson, you will learn how to do the following:

Using Variables

Variables store information. This information may change depending on various circumstances in the macro. Variables can be used to get information at one place in a macro and then use that information in other places throughout the macro.

Variables have some unique qualities. They must be given a name and they must contain a value before they can be used. Corel WordPerfect uses two types of variables: user-defined variables and system variables. For more information on each of these types of variables, see Variables: User-Defined Variables, System Variables, and Arrays in Macro Language Concepts later in this manual.

During this lesson, you will use both user-defined variables and system variables.

Assigning Text to a Variable

One way to make the letters you create with LETTER.WPM look more personal is to insert the recipient's name several times throughout the letter. Using a variable, you can store the recipient's name and then "play back" the name at specific locations.

The INPUT commands you inserted in lesson 2 prompt you to type text, but they do not assign the text to a variable. GETSTRING is a programming command designed to assign text to a variable. To assign the recipient's name to a variable, you will substitute GETSTRING for the second INPUT command in LETTER.WPM.

Open the Macro

1 Choose Open from the File menu.

2 Type c:\corel\wp62\macros\letter.wpm in the Filename entry field.

HINT: If the macro is saved in a directory other than the one above, specify the correct directory.

3 Choose OK.

IMPORTANT: Since you will not record product commands into LETTER.WPM during this lesson, you can open the macro file by choosing Open from the File menu. When you open a macro this way, you are still able to delete existing commands, type new ones, or insert commands from the Macro Commands dialog box. However, you are not able to switch between editing and recording windows unless you press Ctrl+PgUp and choose Macro Record Document.

Edit the Macro

1 Move the cursor to the beginning of the line that reads INPUT("Type recipient's name, then press F9").

2 Press Ctrl+End to delete the line.

3 Press Ctrl+PgUp twice to display the Macro Commands dialog box.

4 Type getstring in the Search entry field, then press Enter.

5 Between the parentheses in the Edit entry field, type the following:

Recipient;"Type recipient's name, then press Enter or choose OK";"Recipient's Name"

6 Choose Insert.

The GETSTRING command you just inserted should look like this:

GETSTRING(Recipient;"Type recipient's name, then press Enter or choose OK";"Recipient's Name")

And the dialog box it displays when the macro runs will look like this:

GETSTRING displays a dialog box with a title and a prompt you specify. It also contains an entry field in which to type text. The text you type in the entry field is assigned to the variable specified in the GETSTRING command. For example, the name you type in response to this dialog box is assigned to variable Recipient.

Since the recipient's name is now assigned to a variable rather than typed into the macro, you must place a Type command after GETSTRING to type out the name.

Inserting the Variable Text

1 Move to the blank line after GETSTRING.

2 Type the following: Type(Recipient)

The macro now inserts the recipient's name like it did before, but it also holds the name in a variable to be used later in the macro.

Decision Making

Let's suppose that as the president of marketing for Pembrook, Ltd., you have the responsibility of interviewing individuals for various positions in your department. As a result, you would like to use LETTER.WPM as a foundation for creating a form letter to send to the applicants. However, not all applicants are the same; some will be hired, some will not be hired, and some will be considered for future openings. It would be nice if the form letter could be customized to each of those situations. Fortunately, by using variables and subroutines, you can introduce some decision making capabilities into the macro.

Revise the Letter

Since LETTER.WPM will soon do more for you than pause while you type in text, rename the macro to FORM.WPM. Once you have renamed the macro, you will have three macros for different purposes: CLOSING.WPM, LETTER.WPM, and FORM.WPM.

To rename the macro,

1 With LETTER.WPM still on your screen, choose Save As from the File menu.

2 Change letter.wpm to form.wpm in the Filename entry field. Make sure the path specified is the correct location for your macros.

3 Choose OK.

Now that this macro will supply the body of the letter for you, you don't need it to prompt or pause while you type the letter.

4 Move the cursor to the third BEEP command.

5 Choose Block from the Edit menu, then block the following commands:

BEEP
INPUT("Type the letter, then press F9")

6 Press Delete.

Since the form letter will provide the text, these commands are no longer necessary. Rather, you will insert the first sentence of the form letter here.

You will remember that you opened LETTER.WPM (and renamed it to FORM.WPM) as a file, so you are not currently in an editing window or able to switch to a recording window. As mentioned earlier, you could press Ctrl+PgUp and choose Macro Record Document to place the macro in an editing/recording mode. However, since the remaining commands are relatively simple, we will type them in rather than record them.

Type in Additional Commands

1 Type the following: Type("Thank you for your interest in a marketing position at Pembrook, Ltd.. We have reviewed your application and resume extensively, "), then press Enter to move to a blank line.

HINT: Be sure to include a space after the comma following "extensively."

This would be a good place to personalize the letter by inserting the applicant's name.

2 Type the following: Type(Recipient), then press Enter once to move to a blank line.

This will insert the applicant's name after the comma. The rest of the letter will follow, but this is the point at which the macro needs to know whether you want to hire, reject, or consider the applicant.

Creating the Dialog Box

To create the dialog box from which you can choose whether to run the hire, reject, or consider subroutine, you will use the programming command MENULIST. For more information on MENULIST, see Programming Commands Reference in this manual.

1 At the new line you just inserted, press Ctrl+PgUp twice.

2 Type MENULIST in the Search entry field, then press Enter.

3 In the Edit entry field, type the following between the parentheses: Decision;{"Hire";"Do Not Hire";"Consider"};"Applicant Status"

4 Choose Insert.

The command you just inserted should look like this:

MENULIST(Decision;{"Hire";"Do Not Hire";"Consider"};"Applicant Status")

The macro is now programmed to display a dialog box listing three alternatives: Hire, Do Not Hire, and Consider. The choices will be numbered in the dialog box. The number of the choice you make is assigned to variable Decision.

At this point, the macro needs to evaluate variable Decision and then type the appropriate text.

Subroutines

A subroutine is a portion of a macro that may execute once, several times, or never, depending on the circumstance of the macro. FORM.WPM will have three subroutines. Each subroutine will simply contain text specific to the hiring decision you have made. Finishing this portion of the macro requires that you create a conditional statement and the subroutines.

Creating a Conditional Statement and Subroutines

You will be creating what is called a "conditional statement." This type of statement evaluates an expression and then executes specific commands. A conditional statement created with SWITCH, CASEOF, and ENDSWITCH can contain the subroutines to execute as well as the expression to evaluate. For more information on these commands, see Programming Commands Reference in this manual.

1 On the blank line following the MENULIST command, press Ctrl+PgUp twice.

2 Type switch in the Search entry field, then press Enter.

3 In the Edit entry field, type Decision between the parentheses, then choose Insert.

The SWITCH command will evaluate variable Decision. Variable Decision will contain the number 1, 2, or 3, depending on the option you have chosen from the MENULIST dialog box. The following CASEOF commands will check to see if their expression (in this case, a number) matches variable Decision. The CASEOF expression that matches will then execute the commands immediately following it.

1 On the new line you just inserted, press Ctrl+PgUp twice.

2 Type caseof in the Search entry field, then press Enter.

3 Press the Spacebar, then type 1:.

4 Press Enter to move to a new line, then type the following:

Type(", and would like to offer you a position with our company. Please contact Benjamin W. Sardoni, our personnel manager, at your earliest convenience to establish a starting date and salary.")

5 Press Enter twice to create a blank line.

You have just created the first subroutine of the conditional statement. The text you just typed will be inserted into your form letter if you choose "Hire", option 1, from the dialog box created with MENULIST. The line that reads CASEOF 1: means that if variable Decision is equal to 1 (the number assigned to "Hire"), execute the commands immediately following the CASEOF statement.

Create the two remaining CASEOF statements and their subroutines by following steps 1-5 above. The only difference will be the number following CASEOF and the text in the Type commands. For the second CASEOF, type the following:

CASEOF 2:
Type(", but have found that your qualifications do not meet our needs at this time. Feel free to resubmit your application as other positions become available. I wish you luck in your future endeavors.")

For the third CASEOF, use the following text:

CASEOF 3:
Type(", and would like to give you an opportunity to interview with our personnel manager, Benjamin W. Sardoni. Please contact him at your earliest convenience to set up an appointment. We look forward to meeting you.")

When you have finished step five after typing the last Type command and its associated text, you must end the series of conditional statements and subroutines with ENDSWITCH.

6 On the new line you just inserted, press Ctrl+PgUp twice.

7 Type endswitch in the Search entry field, then press Enter twice to create a blank line.

The conditional statement and subroutine portion of your macro should now look like this:

SWITCH(Decision)

MENULIST(Decision;{"Hire";"Do Not Hire";"Consider"};"Applicant Status")

CASEOF 1:
Type(", and would like to offer you a position with our company. Please contact Benjamin W. Sardoni, our personnel manager, at your earliest convenience to establish a starting date and salary.")

CASEOF 2:
Type(", but have found that your qualifications do not meet our needs at this time. Feel free to resubmit your application as other positions become available. I wish you luck in your future endeavors.")

CASEOF 3:
Type(", and would like to give you an opportunity to interview with our personnel manager, Benjamin W. Sardoni. Please contact him at your earliest convenience to set up an appointment. We look forward to meeting you.")

ENDSWITCH

The Completed Macro

This macro, FORM.WPM, now lets you assemble a letter with three possible outcomes. You are able to type an inside address and a recipient's name, choose one of three hiring options from a dialog box, and then let the macro finish the letter for you.

The macro should now look like this:

DISPLAY(Off!)

CenterCurrentPage(On!)
DateText
HardReturn
HardReturn
HardReturn
HardReturn
PAUSESET(EndFieldKey)
BEEP
INPUT("Type inside address, then press F9")
HardReturn
HardReturn
Type("Dear ")
BEEP
GETSTRING(Recipient;"Type recipient's name, then press Enter or choose OK";"Recipient's Name")
Type(Recipient)
Type(":")
HardReturn
HardReturn
Type("Thank you for your interest in a marketing position at Pembrook, Ltd. We have reviewed your application and resume extensively, ")
Type(Recipient)

MENULIST(Decision;{"Hire";"Do Not Hire";"Consider"};"Applicant Status")

SWITCH(Decision)

CASEOF 1:
Type(", and would like to offer you a position with our company. Please contact Benjamin W. Sardoni, our personnel manager, at your earliest convenience to establish a starting date and salary.")

CASEOF 2:
Type(", but have found that your qualifications do not meet our needs at this time. Feel free to resubmit your application as other positions become available. I wish you luck in your future endeavors.")

CASEOF 3:
Type(", and would like to give you an opportunity to interview with our personnel manager, Benjamin W. Sardoni. Please contact him at your earliest convenience to set up an appointment. We look forward to meeting you.")

ENDSWITCH

HardReturn
HardReturn
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type("Pembrook, Ltd.")

What Next?

You have now finished lesson 3. To continue to lesson 4, leave FORM.WPM on the screen (you may want to save it again). If you do not want to continue, choose Close from the File menu, then choose Yes to save your changes.

Summary

In this lesson you learned the following:

Lesson 4: Loops and Conditional Statements

You have already learned that macros can automate both simple and complex tasks. Many times, you only need to perform a task once. However, sometimes you may need to perform a task repetitively. Currently, if you needed to create more than one form letter, you would have to run FORM.WPM once for each letter you wanted to create. This wouldn't be difficult or even necessarily time-consuming, but there is a way to program the macro to repeat a specific number of times, thereby creating a number of letters for you. You determine that number, of course, and you accomplish it by using conditional statements and loops.

In this lesson, you will learn how to do the following:

What are Loops and Conditional Statements?

Like the subroutines you added to FORM.WPM in lesson 3, loops are portions of a macro that may need to be used more than once. Sometimes, as will be the case with FORM.WPM, the entire macro is placed in a loop.

Loops are considered subroutines, but not all subroutines are loops. For example, currently there is no way to repeat the SWITCH subroutines in FORM.WPM without repeating the entire macro. A loop, on the other hand, automatically repeats certain commands until a specific condition is met. This condition is provided by a conditional statement; hence the term "conditional loop." A conditional statement may or may not be part of a loop, but the statement always evaluates an expression and then directs the macro to execute appropriate commands.

To allow FORM.WPM to create the number of letters you need, you will place the entire macro in a specific type of loop created with FORNEXT. When the macro is finished you will have one file containing all the letters.

Obtaining Information for the Loop

If you are continuing directly from lesson 3, you should already have FORM.WPM on your screen. If you do not have FORM.WPM on your screen, open it using Open from the File menu.

Before you begin the loop, you need to add a command that asks how many letters you want. Your response to the question will be saved in a variable.

There are many commands in Corel WordPerfect that wait for a response from the user and then assign the response to a variable. MENULIST and GETSTRING are commands you have already used that fall into this category. In this lesson you will use a similar command named GETNUMBER. GETNUMBER displays a dialog box containing a name and prompt that you specify as well as a place to enter a number. The number entered is then assigned to a variable. This variable will be important later in creating the conditional loop.

Inserting the Command

1 Position the cursor after Display(Off!), then press Enter to insert a blank line.

2 Press Ctrl+PgUp twice to display the Macro Commands dialog box.

3 Type getnumber in the Search entry field, then press Enter.

4 Type the following between the parentheses in the Edit entry field:

Number;"How many letters do you want?";"Number of Letters"

5 Choose Insert.

The GETNUMBER command you just inserted should look like this:

GETNUMBER(Number;"How many letters do you want?";"Number of Letters")

The number you type in response to the question this dialog box poses is assigned to variable Number. You will use variable Number to establish the condition for the loop.

Creating the Loop and Conditional Statement

Once the macro knows how many letters you want, it can begin the loop. Remember that a loop should contain only the commands you want repeated more than once. In this case, you want the macro to repeat if you need more than one form letter. However, you don't want GETNUMBER to ask you the same question over and over again. This would be pointless since one response is all that is necessary to give variable Number the information it needs. Also, and perhaps more importantly, if GETNUMBER is included in the loop and continues assigning a new response to the variable, the loop will never know when to quit. For these reasons, you want to begin the loop after the GETNUMBER command. The loop you create here will generate the number of letters you request one after the other. The result is that the letters will all be in one file.

1 Press Ctrl+PgUp twice to display the Macro Commands dialog box.

2 Type fornext in the Search entry field, then press Enter.

3 Type the following between the parentheses in the Edit entry field:

Count;1;Number

4 Choose Insert.

The command you just inserted should look like this:

FORNEXT(Count;1;Number)

FORNEXT is a powerful command, yet it is very simple to use. The first parameter in this command is a variable. You can name the variable anything, but Count seems appropriate. It keeps a count of how many times the loop has run. The second parameter is assigned to variable Count the first time the loop runs. This is how the variable knows where to begin counting. The third parameter tells the loop when to stop. In this case you used variable Number which contains the number you typed in response to GETNUMBER. As soon as variable Count is equal to variable Number, the loop executes one last time and then quits.

Ending the Loop

Now you need to insert an ENDFOR command so the macro knows where the loop ends. The loop should end just after the macro types the company name.

1 Move to the end of the last line of the macro that reads: Type("Pembrook, Ltd."), and press Enter.

2 Press Ctrl+PgUp twice.

3 Type endfor in the Search entry field, then press Enter.

Evaluating the Loop

If you played FORM.WPM right now, you would notice an obvious problem: there is not a hard page break separating each letter. There are a couple of ways to solve this problem, but this lesson will help you solve the problem by adding two product commands to the macro.

1 Place the cursor on the E of ENDFOR, then press Enter.

2 Move to the blank line you just inserted.

3 Type HardPageBreak.

4 Place the cursor just after ENDFOR, then press Enter.

5 Type DeleteCharPrevious.

The last thing the loop does now is insert a hard page break after each letter. This includes the last letter, so if the macro stopped there it would leave a blank page at the bottom. However, placing DeleteCharPrevious after the loop ensures that the last hard page break is deleted.

If you play FORM.WPM now you will see that it has evolved from a simple letter closing to a fairly sophisticated letter-automation macro. It creates any number of letters, each of which can have one of three outcomes.

Now that the macro is finished, you might want to format it to make it easier to read. You can insert extra hard returns, indents, or other formatting codes that organize the macro into meaningful sections. Just remember that the sequence of commands must remain as they are.

FORM.WPM should now contain these commands:

DISPLAY(Off!)
GETNUMBER(Number;"How many letters do you want?";"Number of Letters")
FORNEXT(Count;1;Number)

CenterCurrentPage(On!)
DateText
HardReturn
HardReturn
HardReturn
HardReturn
PAUSESET(EndFieldKey)
BEEP
INPUT("Type inside address, then press F9")
HardReturn
HardReturn
Type("Dear ")
BEEP
GETSTRING (Recipient;"Type recipient's name, then press Enter or choose OK";"Recipient's Name")
Type (Recipient)
Type(":")
HardReturn
HardReturn
Type("Thank you for your interest in a marketing position at Pembrook, Ltd.. We have reviewed your application and resume extensively, ")
Type(Recipient)

MENULIST(Decision;{"Hire";"Do Not Hire";"Consider"};"Applicant Status")

SWITCH(Decision)

CASEOF 1:

Type(", and would like to offer you a position with our company. Please contact Benjamin W. Sardoni, our personnel manager, at your earliest convenience to establish a starting date and salary.")

CASEOF 2:

Type(", but have found that your qualifications do not meet our needs at this time. Feel free to resubmit your application as other positions become available. I wish you luck in your future endeavors.")

CASEOF 3:

Type(", and would like to give you an opportunity to interview with our personnel manager, Benjamin W. Sardoni. Please contact him at your earliest convenience to set up an appointment. We look forward to meeting you.")

ENDSWITCH

HardReturn
HardReturn
Type("Sincerely,")
HardReturn
HardReturn
HardReturn
HardReturn
Type("Sharon Simmons")
HardReturn
Type("President, Marketing")
HardReturn
Type("Pembrook, Ltd.")
HardPageBreak
ENDFOR

DeleteCharPrevious

What Next?

You just finished the final of four lessons. Each lesson has built upon the previous lesson and has provided you with a foundation from which to create your own macros. Macro Language Concepts continues to build upon the knowledge you have gained. For more information on specific macro concepts, please refer to this section.

Finally, there is no substitute for practice and experimentation. The more macros you write, the better you will understand them.

Summary

In this lesson you learned the following:

Macro Language Concepts

Using Programming Commands

Programming commands direct macro execution. For that example, CALL and LABEL are used with loops and conditional statements that direct macro execution when a user-defined condition is met. Other commands, such as ONCANCEL, ONERROR, and ONNOTFOUND, direct macro execution when a cancel, error, or not found condition is met. A command, such as GETSTRING, causes macro execution to stop while a user types information that could be the subject of a memo, the date of an appointment, or the answer to a question.

Anatomy of a Programming Command

A programming command is constructed sequentially from left to right and consists of three parts: command name, parameters, and separators.

Command Name

Programming commands in Corel WordPerfect 6.2 for DOS are generally in uppercase letters to distinguish them from the product commands. However, command names are not case sensitive. You can type them in uppercase, lowercase, or a combination of the two.

Parameters

Many macro commands require additional information to execute properly. This information is provided in the parameters of each command. The parameters let you specify the effect a command will have in your macro. Parameters are enclosed in parentheses. Groups of repeating parameters, such as those in MENULIST, are enclosed in braces ({}).

Separators

If the command contains more than one parameter, each parameter is separated by a semicolon (;).

Syntax

To execute properly, programming commands must be arranged in the correct order. This arrangement is called syntax. To be syntactically correct, each programming command must be spelled correctly and must include all of the required parameters and the necessary separators in the correct order.

Commands that Return a Value

You may notice that some programming commands must be used in combination with other programming commands. This requirement is limited to commands that return a value, such as EXISTS, FRACTION, INDIRECT, and INTEGER.

These types of commands and their parameters are designed to be evaluated as expressions. This means that the value returned by the command can be assigned to a variable such as ASSIGN or evaluated in a conditional statement created with commands such as IF, REPEAT, or WHILE. For example, EXISTS could be used as follows:

IF(EXISTS(TestVar)=0)
        BEEP
ELSE
        GO(Continue)
ENDIF

This example checks the existence of variable TestVar. Notice that EXISTS and its parameter specifying the variable to check are used as part of the IF expression.

If you are familiar with programming concepts, the requirements for using commands that return a value will be a natural transition. If you are new to programming, the concepts are relatively easy to learn. The use of these commands is based on the difference between Functions and Procedures.

Functions perform an action and then return a value. EXISTS is an example of a Function; it checks to see whether the specified variable exists, then returns a value representing the variable table in which the variable exists. FRACTION, INDIRECT, and INTEGER are also examples of Functions.

On the other hand, Procedures simply perform an action. BEEP is an example of a Procedure; it causes the computer to beep, but does not confirm whether the computer beeped or not. Most of the programming commands in Corel WordPerfect 6.2 for DOS are Procedures.

Corel WordPerfect 6.2 for DOS also supports user-defined Functions and Procedures with the commands FUNCTION and PROCEDURE. See Programming Commands Reference in this manual for information on these commands.

Using Parameter Value Types, Variables, and Arrays

Parameter Value Types

Many macro commands (programming and product) require certain information to execute properly. These groups of information, called parameters, let you specify the effect a command will have in a macro. The following section describes the different parameter value types available in Corel WordPerfect 6.2 for DOS.

Character Expression

A character expression is a series of one or more characters enclosed in quotation marks. The quotation marks tell Corel WordPerfect to recognize the characters as text rather than a variable.

For example, if you record a macro that contains the word Name, it appears as "Name" if you edit the macro. However, if a macro contains a variable called Name, the word Name would not be enclosed in quotation marks.

To include quotation marks as part of a character expression, you must use two quotation marks for every one you want typed out. For example, to instruct a macro to type the text "Surprise!" they cheered in unison., a Type command containing the character expression would be constructed as follows:

Type(""Surprise!" they cheered in unison."")

Character expressions can also be concatenated or joined together with the addition operator (+). For example, the command Type("Word"+"Perfect") joins the expressions and types WordPerfect.

Numeric Expression

A numeric expression, in its simplest form, is a number. You can also perform a mathematical operation on a set of numbers to create a numeric expression. For example, 18.3 and 9+132 are both numeric expressions. See Operators in Macro Language Concepts for a list of operators that can be used with numeric expressions.

Numeric expressions do not require quotation marks. If you do enclose a numeric expression in quotation marks, it will be treated as a character expression.

Measurement Expression

A measurement expression is a number representing a measurement. You can also perform a mathematical operation on a set of measurement expressions to make another measurement expression. For example, 1.3" and 2"-0.5" are both measurement expressions. The expression may also include a unit of measurement character. The following is a list of valid characters for specifying a unit of measurement type:

Character Measurement Type
" Inches
i Inches
c Centimeters
m Millimeters
w 1200ths of an inch
u WordPerfect Corporation's WordPerfect 4.2 unit (line/columns)

Relational Expression

Relational expressions have only two possible states: true or false. Relational expressions must be used in combination with commands, such as IF, that can evaluate whether the expression is true or false. For example, 7>5 is a relational expression and could be used in an IF statement as follows:

IF(7>5)
        Type("Seven is greater than five")
ELSE
        Type("Seven is not greater than five")
ENDIF

Since the relational expression in this example would be evaluated as true, the first Type command would execute.

See Operators in Macro Language Concepts for a list of operators that can be used to create relational expressions.

Variable

A variable is a parameter value type that can store other value types. Namely, variables can store character expressions, numeric expressions, measurement expressions, relational expressions, or the contents of other variables. Variables can be used in parameters to represent any expression. As a result, if a parameter expects a specific type of expression, it will also accept a variable containing that type of expression. For example, a measurement expression could be assigned to a variable as follows:

GETUNIT(TMargin;"Specify Top Margin";"Top Margin Dialog Box")
PosDocTop
MarginTop(TMargin)

In this example GETUNIT prompts the user for a measurement expression specifying the top margin. The number is assigned to variable TMargin. This variable is then used to represent the measurement expression in the parameter for MarginTop.

For more information on variables, see Variables in this section.

Variables

A variable represents a place in memory where data is stored. As its name indicates, the data in a variable can change. Using variables you can calculate values and use text that may change during the execution of a macro. Corel WordPerfect uses two types of variables: system variables and user-defined variables.

System Variables

System variables are variables that Corel WordPerfect creates and maintains, such as ?TypeoverActive and ?Name. These variables contain information about the current state of Corel WordPerfect. You cannot change the names or contents of these variables, but you can obtain and use their contents in a macro.

Some system variables contain values corresponding to the numeric equivalents or enumerated types 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, Type only types the numeric equivalent.

Many system variables simply return a value of 0 or 1 depending on whether the Corel WordPerfect state it checks is active or inactive. For example, ?WP51CursorMovement checks to see whether the WP51 Cursor Movement feature is on or off. If it is on, the variable will contain 1; if it is off, the variable will contain 0. Like other variables, these system variables can be used in a conditional statement or a Type command to test or type out their value. For example,

IF(?WP51CursorMovement=1)
     BEEP
ENDIF

or

Type(?WP51CursorMovement)

Some system variables return measurement expressions in the current unit of measurement. However, rather than returning the default unit of measurement specified in the macro, they return the unit of measurement specified in File, Setup, Environment, Units of Measure, and Display/Entry of Numbers. This includes system variables such as ?MarginTop, ?MarginBottom, ?MarginLeft, ?MarginRight, and ?Line.

For a list and description of all system variables provided by Corel WordPerfect 6.2 for DOS, see System Variables Reference in this manual.

User-defined Variables

User-defined variables are variables that you create and name and whose contents you determine. Variable names can include letters and numbers. 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.
Global Available for use anywhere in the current macro as well as in macros named in CHAIN or RUN in the current macro.
Persistent Available for use in the current macro, macros named in CHAIN or RUN in the current macro, and any merges executed in the current session of Corel WordPerfect.

You can specify the variable type using the programming commands LOCAL, GLOBAL, and PERSIST. For more information on these commands, see Programming Commands Reference in this manual.

All user-defined variables can contain text or numbers. There are a number of programming commands that assign variables. See Programming Commands Reference for information on ASSIGN, CHAR, FOR, FOREACH, GETNUMBER, GETSTRING, GETUNITS, 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 Programming Commands Reference in this manual.

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.

Using Subroutines, Loops, and Conditional Statements

Subroutines

A subroutine is a set of commands you may want to execute several times throughout a macro. Instead of entering the commands at several locations in the macro, you 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. LABEL combined with GO can also create a loop. See Loops and Conditional Statements below. A macro is directed to a subroutine with programming commands such as CALL, GO, ONERROR, ONCANCEL, and ONNOTFOUND. See Programming Commands Reference for more information on these commands.

Since there may be more than one subroutine in a macro, the name assigned to each subroutine must be unique. The label name must be located 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.

Loops and Conditional Statements

A loop is a series of commands that repeats 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 instance, a macro can search for and delete every occurrence of a specific word or create a certain number of labels. You could create a macro to display a prompt requesting the number of return addresses to create. The loop will then continue creating addresses until that number has been reached. For example,

Display(Off!)
PAUSESET(EndFieldKey)
INPUT("Type address, then press F9")
GETNUMBER(Number;"How many copies of the address do you want?";"Copies")

BlockOn(CharMode!)
PosDocTop
ASSIGN(Address;?BlockedText)
BlockOn(CharMode!)
PosDocBottom
BlockDelete

FORNEXT(Count;1;Number;1)
        Type(Address)
        HardPageBreak
ENDFOR

A conditional statement is similar to a loop. Like loops, conditional statements evaluate an expression and then perform a specific action depending on the result of the evaluation. However, a conditional statement does not automatically repeat. If you want to repeat a conditional statement, it must be located within a loop. For example:

Display(Off!)
LABEL(Begin)
PAUSESET(EndFieldKey)
INPUT("Type address, then press F9")

HardPageBreak

CHAR(More;"Create another label? y/n")

IF(NTOC(More)="y"|NTOC(More)="Y")
     GO(Begin)
ELSE
     BREAK
ENDIF

The following programming commands can be used to create loops or conditional statements. See Programming Commands Reference for a complete description and example of each command.

Command Combination Description
FOR - ENDFOR A set of commands repeats for a specified number of times.
FOREACH - ENDFOR A set of commands repeats for a specified circumstance.
LABEL - GO GO continually redirects the macro to LABEL until a specific condition is met or until BREAK is encountered.
IF - ENDIF A set of commands repeats if a specified condition is satisfied. This is a conditional statement that can be included in a loop.
REPEAT - UNTIL A set of commands repeats until a condition has been satisfied.
WHILE - ENDWHILE A set of commands repeats only while a specific condition exists.

Operators

An operator is a symbol or word that performs a function on one or more expressions. For instance, operators add, subtract, divide, and multiply numbers, combine or concatenate character expressions, and compare expressions.

Operator Precedence

Corel WordPerfect can evaluate expressions with several operators. Consequently, some order of evaluation must be followed. The operator precedence used by Corel 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 () (parentheses), - (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. For instance, in the expression ((4+(6/2))/9), 6/2 is performed first since it is in the innermost parentheses set. Next, the result of this division is added to 4 since this is the second innermost parentheses set. Finally, the sum is divided by 9 which is the operation specified in the outermost parentheses set.

In the expression 4+7*8, the multiplication (7*8) is performed first, followed by the addition. This is because multiplication has a higher precedence than addition. The result is 60. if you wanted the addition to be performed first, you would create the expression (4+7)*8. In this case the result is 88.

Combining Character Expressions

Character expressions, or variables containing character expressions, can be combined or concatenated with the + operator. For example, to combine the words Word and Perfect, each character expression could be combined in a Type command as follows:

Type("Word" + "Perfect")

This command would type the word WordPerfect.

You can also combine variables containing character expressions, for example:

ASSIGN(Verb;"Draw")
Type(Verb + "ing")

This example assigns the character expression Draw to variable Verb. The + operator then combines variable Verb and the character expression ing so the Type command types Drawing. Note that the variable should not be enclosed in quotation marks since it is not a character expression itself; the quotation marks are part of the character expression variable Verb contains.

Programming Commands Reference

// (comment command)

Comment (//) reserves text between the comment command (//) and the next hard return (HRt) as comments. Anything reserved as a comment will be ignored by the macro. Comments are used to document a macro without affecting its execution.

Syntax

// Comments [Hrt]

Parameters

Comments
A character expression or a numeric expression

Example

This macro opens and prints all documents in the default directory.

DISPLAY(On!)

DLGInput(on!)   // allows keystrokes to be sent to a dialog
                // box
FileManagerDlg
HardReturn
DownArrow
tot:=?List-2
Cancelkey
cnt:=1
        WHILE(tot<>cnt)
FileManagerDlg
FileManagerDlg
DownArrow
type("1")       //opens the highlighted document
PrintFullDoc
ExitDlg
Type("nn")      //"No" to save and "No" to exit
                //Corel WordPerfect
cnt:=cnt+1
        ENDWHILE

AND

AND is an operator that evaluates two expressions, usually in a conditional statement. Conditional statements can be created with commands such as IF, REPEAT, and WHILE. This operator performs a logical AND that evaluates a conditional statement as true only if both the expressions are true.

Example

This macro counts keystrokes until the user presses Ctrl-Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

ASSERT

ASSERT causes a macro to respond as if one of three conditions exists. This command can assert (or cause) an Error, a Cancel, or a Not Found condition. Each of these conditions can be used to end a macro or redirect macro flow. To redirect the flow of a macro to a specific LABEL, you can use ONCANCEL, ONERROR, or ONNOTFOUND. A macro will stop if it has not encountered one of these commands before the corresponding condition has been asserted. ASSERT will have no effect if a CANCEL, ERROR, or NOTFOUND command has been used before the ASSERT command to disable detection of these conditions.

Syntax

ASSERT(Condition)

Parameters

Condition
Specifies the condition to assert. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
CancelCondition! 0 Asserts a Cancel
ErrorCondition! 1 Asserts an Error
NotFoundCondition! 2 Asserts a Not Found

Example

This macro prompts the user to highlight text in a document. The macro then assigns the text to a variable.

Display(On!)

ONERROR(error)

LABEL(Begin)
BlockKey
PROMPT("Highlight the text to assign to a variable and press Enter")
PAUSE
x:=?BlockedText

IF (x="")
        ASSERT(ErrorCondition!)
ENDIF
        //place more code here to make this macro more functional
QUIT

LABEL(Error)
BEEP
DisplayRewrite
PROMPT("You must select text to assign it to a variable")
PAUSE
GO(Begin)

See Also

ASSIGN

ASSIGN places a value in a Corel WordPerfect variable. The values can be a numeric expression, measurement expression, character expression, or other variables. Consider the following examples:

ASSIGN (PERIOD; "Renaissance")

This ASSIGN statement assigns the word "Renaissance" to variable PERIOD. Note the quotation marks around the character expression.

ASSIGN (SUM; NUMBER+19)

This ASSIGN statement assigns 19 plus the value of the variable NUMBER to the variable SUM. For example, if variable NUMBER is 10, variable SUM will be assigned the value of 29.

ASSIGN can also be used to create arrays. For more information on arrays, see Macro Language Concepts.

Syntax

ASSIGN (Variable;Expression)

or

Variable=Expression

or

Variable:=Expression

Parameters

Variable
Any variable less than 29 characters in length can be used in this parameter.
Expression
All expressions, including variables, can be used in this parameter.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

BEEP

The computer beeps when this command is executed. BEEP is often used to prompt the user when a macro pauses or displays a message.

Syntax

BEEP

Example

This macro beeps and displays a message if the current document is blank.

DISPLAY(Off!)
IF(?DocBlank)
        BEEP
        DISPLAY(On!)
        PROMPT("The document is blank.  Press Tab to continue")
        PAUSEKEY(TabKey)
        DISPLAY(Off!)
        QUIT
ENDIF

See Also

BREAK

BREAK breaks out of loops or statements created with SWITCH, FORNEXT, REPEAT, or WHILE commands. At the point this command is encountered, the macro is redirected to the end of the loop or statement, and resumes execution. For example, if this command breaks out of a WHILE loop, the macro is redirected to the command immediately following the ENDWHILE command and continues from that point.

Syntax

BREAK

Example

This macro counts from one to ten and breaks out of the loop when it reaches the number seven.

DISPLAY(Off!)
        FORNEXT(x;1;9;1)
        Type(x)
IF(x=7)
        BREAK
ENDIF
        ENDFOR

See Also

CALL

The CALL command redirects macro execution to the LABEL command specified in the Label parameter. The macro executes from that point until it encounters a RETURN command. Macro execution then returns to the command immediately following the CALL command and resumes from that point. This command is useful for repeating a subroutine from any location in the macro.

Syntax

CALL(Label)

Parameters:

Label
Any combination of text can specify the label. The label name used here must correspond to a LABEL command in the same macro.

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

CANCEL

CANCEL determines whether to ignore a Cancel condition while a macro is running. A Cancel condition is created by pressing the Cancel key or by using the ASSERT(CancelCondition!) command. By default, a Cancel condition is not ignored and will affect macro execution. A Cancel will generally stop a macro, but it can also be used to redirect execution using ONCANCEL. If an ONCANCEL command is encountered in the macro before a Cancel occurs, the macro is redirected to the LABEL specified in ONCANCEL. Pressing Ctrl+Break always terminates a macro even if CANCEL(Off!) is used.

Syntax

CANCEL(State)

Parameters

State
Specifies whether to ignore cancel conditions. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Ignore Cancel conditions
On! 1 Do not ignore Cancel conditions

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

CASEOF

CASEOF creates individual cases against which a single SWITCH expression is compared. Each CASEOF can contain one or more expressions which, when evaluated individually, may be true, or in other words, provide a match for the SWITCH expression.

For example,

SWITCH(Year)
CASEOF 1776:
        GO(Independence)
CASEOF 1988;1992:
        GO(Elections)
ENDSWITCH

The first CASEOF is true, or a match, if the SWITCH expression (variable Year) contains the number 1776. The second CASEOF is a match if variable Year contains either 1988 or 1992. In other words, if a CASEOF contains more than one expression, the semi-colon acts as an "or" rather than as an "and." Both the SWITCH and the CASEOF expressions are case sensitive (capitalization) and must match exactly. If a CASEOF match is found for the SWITCH expression, the commands immediately following that CASEOF will be executed and the macro does not evaluate any other CASEOF expression.

Syntax

CASEOF(Expression;Expression;...:)

Parameters

Expression
Specifies the expression to evaluate. All expressions are valid for this parameter.

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

CHAIN

CHAIN executes the specified macro when the current macro ends. Unlike other commands, the CHAIN command does not take effect when it is encountered. Regardless of where the CHAIN command is placed in the macro, it does not execute the chained macro until the current macro has finished.

If a macro contains more than one CHAIN command, only the macro specified in the last encountered CHAIN command is executed. A QUIT command at the end of the active macro overrides any pending CHAIN command and will not allow execution of the chained macro.

CHAIN looks for the specified macro first in the current directory, then in the macros directories, and finally in the shared Corel WP directory (this directory will be wherever the .FIL file is located).

Syntax

CHAIN(Filename)

Parameters

Filename
A character expression specifying the macro to chain.

Example

This macro displays a dialog box on the screen. Pending the user's response, the macro chains the correct macro.

DISPLAY(Off!)

DLGCREATE(x;"TITLE";DLGNoCancel!;;;30;14)
        DLGCONTROL(CtrlRadioButton!;a;"Letter";StyInitial!;4;4;;2)
        DLGCONTROL(CtrlRadioButton!;b;"Itinerary";;4;6;;2)
        DLGCONTROL(CtrlRadioButton!;c;"Memo";;4;8;;2)
        DLGCONTROL(CtrlRadioButton!;d;"Fax";;4;10;;2)
DLGEND

SWITCH (1)
        CASEOF a : CHAIN("letter")
        CASEOF b : CHAIN("Itin")
        CASEOF c : CHAIN("memo")
        CASEOF d : CHAIN("fax")
ENDSWITCH

See Also

CHAR

The CHAR, or character, command prompts the user for a keystroke. The numeric equivalent (ASCII value) of the keystroke is then assigned to the variable specified in the CHAR command. As the name indicates, only one character is accepted and assigned to the variable. If the user enters more than one character or presses more than one keystroke, only the first is accepted. If more than one keystroke needs to be assigned to a variable, use GETSTRING, GETNUMBER, OR GETUNITS.

Generally, the keystroke is given in response to a question posed in the optional prompt parameter of this command. The variable containing the numeric equivalent of the keystroke can be evaluated later in the macro using commands such as IF or SWITCH. The numeric equivalent of the keystroke can also be converted back to the original keystroke using NTOC. For a list of keystrokes and their numeric equivalents, see Appendix A: Keystroke Numeric Equivalents.

Syntax

CHAR(Variable;Prompt)

Parameters

Variable
Specifies the variable to which the numeric equivalent of the keystroke will be assigned. Any variable is valid for this parameter.
Prompt (optional)
A character expression that will display as a prompt on the status line.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

CONTINUE

CONTINUE is used in a SWITCH statement to instruct a macro, after executing one CASEOF, to continue to the next CASEOF and execute it without evaluating its expression. This command is optional and is not required as part of a SWITCH statement.

Syntax

CONTINUE

Example

This macro either types a name, an address, or the entire name and address.

DLGCREATE(x;"TITLE";DLGNoCancel!;;;30;14)
        DLGCONTROL(CtrlRadioButton!;a;"Name";StyInitial!;4;4;10;2)
        DLGCONTROL(CtrlRadioButton!;b;"Full Address";;4;6;10;2)
        DLGCONTROL(CtrlRadioButton!;c;"Address only";;4;8;10;2)
DLGEND

SWITCH (1)
        CASEOF a :  Type("John Doe")
        CASEOF b :  Type("John Doe")
        HRt
        CONTINUE
        CASEOF c :  Type("123 Anywhere")
ENDSWITCH

See Also

CTON

CTON (character to number) converts a character or keystroke to its numeric equivalent. For a list of numeric equivalents, see Appendix A: Keystroke Numeric Equivalents.

Syntax

CTON(Character)

Parameters

Character
Any ASCII character or a variable containing an ASCII character.

Example

This macro prompts for a character and returns its Corel WordPerfect assigned numeric equivalent.

GETSTRING(num;"Enter a character:")
numequiv:=CTON(num)
PROMPT("The Corel WordPerfect assigned numeric equivalent of "+num+" is "+numequiv+".")
PAUSE

See Also

DEFAULT

DEFAULT is used with the SWITCH command to specify a series of commands to execute if all CASEOF expressions are false. This command is an optional part of a SWITCH statement, but is useful for providing a default action if all other cases are false.

Syntax

DEFAULT:

Parameters

There are no parameters, but DEFAULT is always followed by macro commands to execute.

Example

This macro constantly prompts for a name until Cancel or Enter is pressed.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

DEFAULTUNITS

DEFAULTUNITS sets the default unit of measurement for any measurement expression that does not contain a unit of measure character.

Syntax

DEFAULTUNITS(Measurement)

Parameters

Measurement
Specifies the default unit of measurement for measurement expressions. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Inches! 0 Inches as default (")
InchesI! 1 Inches as default (i)
Centimeters! 2 Centimeters as default
Millimeters! 3 Millimeters as default
Points! 4 Points as default
WP1200ths! 5 1200ths of an inch as default
WP42Units! 6 WordPerfect Corporation's WordPerfect 4.2 units as default

Example

This macro advances four centimeters from the top of the page regardless of the current unit of measure.

DISPLAY(Off!)
DEFAULTUNITS(Centimeters!)
Advance(AdvanceFromTop!;4)

DISCARD

DISCARD removes variable definitions from the current macro as well as variables set with PERSIST or PERSISTALL. Variables might reside in one of three variable tables: Local, Global, and Persistent. Variables are discarded in that order. For example, to discard local, global, and persistent variables all named ABBEY, you would need to DISCARD(ABBEY) three times to remove ABBEY from all tables. This command does not specify the table from which the variable should be discarded; the command must simply be repeated enough times to clear the desired tables. This could be done easily in a WHILE loop, for example:

WHILE(EXISTS(Abbey))
DISCARD(Abbey)
ENDWHILE

Syntax

DISCARD(Var1;Var2;...VarN)

Parameters

Variable
Any variable is valid for this parameter.

Example

This macro checks to see if the variable Choice is in memory. If it is, it prompts the user for permission to remove it from memory.

IF(EXISTS(choice))
        LABEL(question)
        CHAR(ans;"Variable CHOICE already exists.
             Remove it from memory so this macro can run? (y/n)")
SWITCH(TOUPPER(NTOC(ans)))
        CASEOF "Y" : DISCARD(choice)
        CASEOF "N" : QUIT
        DEFAULT    : GO(question)
ENDSWITCH
ENDIF

//enter additional code here to make this macro more functional.

See Also

DISPLAY

DISPLAY determines whether to display macro execution. DISPLAY(Off!) is inserted at the beginning of recorded macros and will remain in effect until replaced with DISPLAY (On!) or deleted from the macro.

Syntax

DISPLAY(State)

Parameters

State
Specifies whether macro display is on. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Display off
On! 1 Display on

Example

This macro beeps and displays a message if the current document is blank.

DISPLAY(Off!)
IF(?DocBlank)
        BEEP
        DISPLAY(On!)
        PROMPT("The document is blank.  Press Tab to continue")
        PAUSEKEY(TabKey)
        DISPLAY(Off!)
        QUIT
ENDIF

DIV

DIV is an operator that performs a division and returns the integer portion of the quotient. For example, if the quotient is 2.5, DIV returns 2. DIV must be used in an expression that can be evaluated by commands such as IF and ASSIGN. DIV is preceded and followed by expressions to divide, for example, 10 DIV 2.

Example

This macro averages a series of numbers and returns the quotient value of the average.

ASSIGN(Last;0)
GETNUMBER(HowMany;"How many numbers do you have to average")
ASSIGN(Y;0)

FORNEXT(Count;1;HowMany)
        GETNUMBER(INDIRECT("Number"+Count);"Enter in a number  ")
        ASSIGN(last;last+Indirect("Number"+Count))
ENDFOR

Type("The quotient of the average of ")

FORNEXT(X;1;HowMany)
        Type(Indirect("Number"+x)+"+")
ENDFOR

DeleteCharPrevious

Type(" is "+last DIV howmany)

See Also

DLGCONTROL

DLGCONTROL adds controls such as check boxes, push buttons and radio buttons to a dialog box. This command customizes the appearance and use of a dialog box and must be used between DLGCREATE and DLGEND commands.

Syntax

DLGCONTROL(Type;Variable;Title;Style;Horizontal Position;Vertical Position;Wide;High)

Parameters

Type
Specifies the control type to add to the dialog box. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
CtrlLabel! 0 Not numbered and cannot be selected. Useful for adding descriptive text to a dialog. Does not require the Variable parameter.
CtrlOption! 1 A numbered menu item that can be selected. Forces an exit from a dialog box when selected. Does not require the Variable parameter.
CtrlPushbutton! 2 A push button that forces an exit when selected. Does not require the Variable parameter.
CtrlCheckbox! 3 A numbered check box that can be selected. If the variable parameter is 0, the check box will not be checked. When the dialog is dismissed, the variable will return the state of the control (0=Checkbox not marked, 1=Checkbox marked).
CtrlRadiobutton! 4 A numbered radio button. If the variable parameter is 0, the radio button will not be selected. When the dialog is dismissed, the variable will return the state of the control (0=Radio button not selected, 1=Radio button selected). To be in the same group, radio button controls must be consecutive. Radio buttons are mutually exclusive.
CtrlNumber! 5 A numbered entry field that accepts only positive numbers. The variable sets the initial value and when the dialog is dismissed, returns the value of the control.
CtrlMeasure! 6 An entry field that accepts only measurements. The measurement is displayed in the current unit of measurement. The variable sets the initial value and when the dialog is dismissed, returns the value of the control.
CtrlText! 7 An entry field that accepts a single line of text. The line length allowed is determined by the width parameter.
CtrlFilename! 8 An entry field that accepts only ASCII characters and no spaces. The variable set the initial value and when the dialog is dismissed, returns the value of the control.
CtrlList! 9 A list box. The variable must be the name of an array that defines each item in the list. The array requirements are: Var[0]=number of items in list box. Var[1] - Var[x]=each list box item.
CtrlDropList! 10 A drop list. Same requirements for CtrlList! above.
Variable (optional)
Sets values to and returns values from the controls. See control type descriptions for information on how the variable works with specific controls.
Title (optional)
A character expression specifying the control title. To create a mnemonic letter in the title, precede the letter with a tilde (~).
Style (optional)
Specifies a control style. The styles can be concatenated with a plus sign (+), for example, (StyNoSpaces!+StyNoNumber!). Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
StyOK! 1 Makes a CtrlPushButton! function as the OK button. The variable will be 0 if the pushbutton dismissed the dialog.
StyCancel! 2 Makes a CtrlPushButton! function as the Cancel button. The variable will be -1 if the pushbutton dismissed the dialog.
StySigned! 4 Allows CtrlNumber! control to accept negative numbers.
StyCounter! 8 Adds counter controls (up/down arrows) to the CtrlNumber! control.
StyNoSpaces! 16 Prohibits spaces from being entered in the CtrlText! control. With this style, the space bar will terminate input.
StyNoBox! 32 Removes the box surrounding list or entry controls in Text Mode.
StyNoSort! 64 Prevents items in a list control from being sorted.
StyChild! 128 Makes the control a child or sub-control of the previous non-child control.
StyNoScroll! 256 Turns off the scroll bar on a CtrlList! control.
StyNoNumber! 512 Removes the number on a numbered control. A control with this style cannot be selected with a number, however mnemonics can still be used.
StyDancing! 1024 Allows a control to display only when it can be selected.
StyNoPeriod! 2048 Removes the period after a control number.
StyGray! 4096 Prevents a control from being selected.
StyMnemonic! 8192 Replaces the control number with the mnemonic character specified in the title parameter.
StyInitial! 16384 Specifies the control as the active control when a dialog is initially displayed.
StyDefault! 32768 Specifies the control as the default control. Any time the cursor would normally return to the OK button, it will move to this control instead.
Horizontal Position (optional)
A numeric expression specifying the horizontal position of the control within the dialog. The position is determined in character spaces by rows and columns with 0 being the first column, first row (upper left position).
Vertical Position (optional)
See Horizontal Position parameter above.
Width (optional)
A numeric expression specifying the width of the control in character spaces. If this parameter is not specified, the control conforms to the size of the control title.
Height (optional)
See Width parameter description above. If this parameter is not specified, the height is set to 2.

Example

This macro displays a dialog box with all the control options.

chkbox:=1
num:=31
LstAry:={"One";"Uno";"Ein"}

DLGCREATE(x;"TITLE";DLGNoCancel!;;;50;20)
        DLGCONTROL(CtrlLabel!;;"Descriptive Label";StyGray!;1;1;5;1)
        DLGCONTROL(CtrlOption!;;"Option";StyNoNumber!;30;3;10;2)
        DLGCONTROL(CtrlPushButton!;;"PushButton";StyNoNumber!
        ;4;5;11;2)
        DLGCONTROL(CtrlCheckBox!;chkbox;"CheckBox";StyNoNumber!
        ;30;5;9;2)
        DLGCONTROL(CtrlRadioButton!;VarRB;"RadioButton";StyInitial!;4;3;10;2)
        DLGCONTROL(CtrlNumber!;num;"Number";StySigned!+StyCounter!
        ;4;7;3;2)
        DLGCONTROL(CtrlMeasure!;meas;"Measurement";StyNoNumber!
        +StyNoBox!;30;7;3;2)
        DLGCONTROL(CtrlText!;txt;"Text";StyNoNumber!;4;9;35;2)
        DLGCONTROL(CtrlFilename!;flname;"~Filename";StyMnemonic!
        ;4;11;12;2)
        DLGCONTROL(CtrlList!;LstAry;"List";StyNoSort!;4;13;12;3)
        DLGCONTROL(CtrlDropList!;LstAry;"Drop List";StyNoSort!
        +StyNoNumber!;25;13;12;3)
DLGEND

See Also

DLGCREATE

DLGCREATE is the opening command for creating and displaying a dialog box. The dialog box is displayed when this command is encountered. This command must be followed by at least one control defined by DLGCONTROL.

Syntax

DLGCREATE(Variable;Title;Style;Horizontal Position;Vertical Position;Width;Height)

Parameters

Variable
Specifies the variable containing the number of the Control used to dismiss the dialog.
Control Numeric Equivalent Description
OK 0 Dialog dismissed with OK.
Cancel -1 Dialog dismissed with Cancel.
User-defined control X Where "X" is the number of the control. Control numbers are determined by the order in which they are created by a DLGCONTROL command. For example, the first control defined is 1, the second defined is 2, and so forth.
Title
A character expression specifying the dialog title.
Style
Specifies the dialog style. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
DlgNoOK! 1 Removes OK button
DlgNoCancel! 2 Removes Cancel button
DlgNoBorder! 4 Removes border
DlgNoShadow! 8 Removes shadow
DlgExit! 16 Dismisses the dialog immediately after the first key or control is pressed
DlgNoClear! 32 Does not save or restore the screen
DlgInactive! 64 Dialog displays while macro execution continues
Horizontal Position (optional)
A numeric expression specifying the horizontal position of the dialog. The position is determined in character spaces by rows and columns with 0 being the first column, first row (upper left position). If no position is specified, the dialog is centered.
Vertical Position (optional)
See Horizontal Position parameter above.
Width (optional)
A numeric expression specifying the width of the dialog in character spaces. If this parameter is not specified, the control is sized to accommodate the number of controls.
Height (optional)
See Width parameter above.

Example

This macro displays a dialog box on the screen. Pending the user's response, the macro chains the correct macro.

DISPLAY(Off!)

DLGCREATE(x;"TITLE";DLGNoCancel!;;;30;14)
        DLGCONTROL(CtrlRadioButton!;a;"Letter";StyInitial!;4;4;;2)
        DLGCONTROL(CtrlRadioButton!;b;"Itinerary";;4;6;;2)
        DLGCONTROL(CtrlRadioButton!;c;"Memo";;4;8;;2)
        DLGCONTROL(CtrlRadioButton!;d;"Fax";;4;10;;2)
DLGEND

SWITCH (1)
        CASEOF a : CHAIN("letter")
        CASEOF b : CHAIN("Itin")
        CASEOF c : CHAIN("memo")
        CASEOF d : CHAIN("fax")
ENDSWITCH

See Also

DLGEND

DLGEND is the closing command for creating and displaying dialog boxes.

Syntax

DLGEND

Example

This macro displays a dialog box on the screen. Pending the user's response, the macro chains the correct macro.

DISPLAY(Off!)

DLGCREATE(x;"TITLE";DLGNoCancel!;;;30;14)
        DLGCONTROL(CtrlRadioButton!;a;"Letter";StyInitial!;4;4;;2)
        DLGCONTROL(CtrlRadioButton!;b;"Itinerary";;4;6;;2)
        DLGCONTROL(CtrlRadioButton!;c;"Memo";;4;8;;2)
        DLGCONTROL(CtrlRadioButton!;d;"Fax";;4;10;;2)
DLGEND

SWITCH (1)
        CASEOF a : CHAIN("letter")
        CASEOF b : CHAIN("Itin")
        CASEOF c : CHAIN("memo")
        CASEOF d : CHAIN("fax")
ENDSWITCH

See Also

DLGINPUT

DLGINPUT determines whether to suspend macro execution while a dialog box is displayed. If execution is suspended, the user must close the dialog box before the macro continues. If execution is not suspended, the macro can be programmed to make selections in the dialog box as well as close it. The default macro state is DLGINPUT(Off!).

Syntax

DLGINPUT(State)

Parameters

State
Specifies whether macro execution is suspended. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Suspend macro execution
On! 1 Do not suspend macro execution

Example

This macro opens and prints all documents in the default directory.

DISPLAY(On!)

DLGInput(on!)   // allows keystrokes to be sent to a dialog box
FileManagerDlg
HardReturn
DownArrow
tot:=?List-2
Cancelkey
cnt:=1
        WHILE(tot<>cnt)
FileManagerDlg
FileManagerDlg
DownArrow
Type("1")       //opens the highlighted document
PrintFullDoc
ExitDlg
Type("nn")                      //"No" to save and "No" to exit
                                //Corel WordPerfect
cnt:=cnt+1
        ENDWHILE

ELSE

ELSE is used with the IF command to specify macro commands to execute when the IF statement is false. Commands placed between the ELSE and the ENDIF commands are executed only if the value of the relational expression in the IF statement is false. If ELSE is not used within an IF statement, and if the statement is false, the macro moves to the command following ENDIF and resumes execution.

Syntax

ELSE

Example

This macro prints the current document path and filename in a footer.

IF(?Name<>"")
        FooterB(Create!)
        Type(?Path+?Name)
        SubstructureExit
ELSE
        PROMPT("The file hasn't been saved yet.  Please save and re-run the macro.")
        PAUSE
ENDIF

See Also

ENDFOR

ENDFOR is the closing command for a FORNEXT-ENDFOR and a FOREACH-ENDFOR loop.

Syntax

ENDFOR

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

ENDFUNC

ENDFUNC is the closing command for a FUNCTION definition.

Syntax

ENDFUNC

Example

This macro executes a function from within a Type command.

Prmt:="Would you like to continue?"
Type ("You pressed "+YesNo(prmt))

                //More code for the macro could be inserted here
Quit

FUNCTION YesNo (message)
LOCAL(ans)
LABEL(Begin)
CHAR(ans;message+"  Y/N")
        SWITCH(TOLOWER(NTOC(ans)))
CASEOF "y" : ans:="Y"
CASEOF "n" : ans:="N"
DEFAULT    : GO(Begin)
        ENDSWITCH
RETURN(ans)
ENDFUNC

See Also

ENDIF

ENDIF is the closing command for an IF-ENDIF conditional statement.

Syntax

ENDIF

Example

This macro prints the current document path and filename in a footer.

IF(?Name<>"")
        FooterB(Create!)
        Type(?Path+?Name)
        SubstructureExit
ELSE
        PROMPT("The file hasn't been saved yet.  Please save and re-run the macro.")
        PAUSE
ENDIF

See Also

ENDIFPLATFORM

ENDIFPLATFORM is the closing command for an IFPLATFORM-ENDIFPLATFORM statement.

Syntax

ENDIFPLATFORM (PlatformId)

Parameters

PlatformId (optional)
Contains the platform or platforms specified in IFPLATFORM.

Example

This macro executes in either Corel WordPerfect 6.2 for DOS or Corel WordPerfect 6.0/6.1 for Windows(R). It nests or runs the appropriate macro for each application. The macros MEMO.WPM and WPMAIL.WCM must have already been created.

IFPLATFORM("DOS")
        //This code will only execute when run in Corel WordPerfect
        //6.2 for DOS
        NEST("c:\corel\wp62\macros\Memo.wpm")
ENDIFPLATFORM

IFPLATFORM("WIN")
    //This code will only execute in Corel WordPerfect 6.1
    //for Windows.
APPLICATION(A1; "Corel WordPerfect"; Default; "US")
           RUN("c:\wpwin61\macros\WPMail.wcm")
        ENDIFPLATFORM

See Also

ENDPROC

ENDPROC is the closing command for a PROCEDURE definition.

Syntax

ENDPROC

Example

This macro prompts for a file to retrieve. It then calls a Procedure to retrieve the file.

GLOBAL(Path;Filename)

LABEL(Begin)
GETSTRING(Path;"Enter the Path of the file to retrieve.")
GETSTRING(Filename;"Enter the filename to retrieve.")
Retrieve()              //calls the procedure Retrieve
ERROR(Off!)
        IF(?Name="")
GO(Begin)
        ENDIF

QUIT

PROCEDURE Retrieve()
        ONERROR CALL(Error)
        FileRetrieve(Path+Filename)
ENDPROC

LABEL(Error)
INPUT("The File doesn't exist.  Press Enter to continue")
RETURN

See Also

ENDSWITCH

ENDSWITCH is the closing command for a SWITCH-ENDSWITCH conditional statement.

Syntax

ENDSWITCH

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

ENDWHILE

ENDWHILE is the closing statement for a WHILE-ENDWHILE loop.

Syntax

ENDWHILE

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

ERROR

ERROR determines whether an error condition should be ignored while a macro is running. By default, an error is not ignored and generally stops macro execution. ERROR can also redirect execution with ONERROR. If an ONERROR command is encountered in the macro before an Error occurs, the macro is redirected to the LABEL specified in ONERROR.

Syntax

Error(State)

Parameters

State
Specifies whether to ignore errors. Select an enumerated type or its numeric equivalent.
Enumerated TypeNumeric EquivalentDescription
Off!0Ignore errors
On!1Do not ignore errors

Example

This macro prompts for a file to retrieve. It then calls a Procedure to retrieve the file.

GLOBAL(Path;Filename)

LABEL(Begin)
GETSTRING(Path;"Enter the Path of the file to retrieve.")
GETSTRING(Filename;"Enter the filename to retrieve.")
Retrieve()              //calls the procedure Retrieve
ERROR(Off!)
        IF(?Name="")
GO(Begin)
        ENDIF

QUIT

PROCEDURE Retrieve()
        ONERROR CALL(Error)
        FileRetrieve(Path+Filename)
ENDPROC

LABEL(Error)
INPUT("The File doesn't exist.  Press Enter to continue")
RETURN

See Also

EXISTS

EXISTS is used in conjunction with other commands, such as IF, to determine if the specified variable exists. For a variable to exist, it must have been assigned a value. The value returned represents the variable table in which the variable exists.

ValueDescription
0Does not exist
1Exists in local table
2Exists in global table
3Exists in persist table

Syntax

EXISTS(Variable)

Parameters

Variable
Specifies the variable to evaluate.

Example

This macro checks to see if a typist's initials are assigned to the variable init. If the initials are not stored in a variable in memory, this macro assigns them to a variable. If they are, this macro prompts the user to see if the initials are correct.

IF(EXISTS(init))
        LABEL(again)
        CHAR(ans;"Are the typist's initials """+init+""" (y/n)")

SWITCH(TOUPPER(NTOC(ans)))
        CASEOF  "N" :  PERSIST(init)
        GETSTRING(init;"Enter the typist's initials.")
        CASEOF  "Y" :  BREAK
        DEFAULT     :  GO(again)
ENDSWITCH
ELSE
        PERSIST(init)
        GETSTRING(init;"Enter the typist's initials.")
ENDIF

MergeRun(FormFile!;"memo.frm";FormFile!;;ToNewDoc!)

See Also

FOR

FOR is the opening statement of the FOR-ENDFOR conditional loop. The command begins a loop which executes all commands between the FOR and ENDFOR commands. The number of times this loop runs depends on the values given to the Control Variable, Initial Value, TerminateExp, and IncrementExp parameters. For example, consider the command below:

For (VAR01; 3; VAR01<20; VAR01 + 2)

The first time through the loop, the variable in the Control Variable parameter (VAR01), is assigned the value of the Initial Value parameter (3). The macro then checks to see if the TerminateExp parameter (VAR01<20) is true. If the TerminateExp parameter is true, the commands between FOR and ENDFOR run. The IncrementExp parameter (VAR01+2) then assigns the variable in the Control Variable parameter a new value. (In this case, since VAR01 had the value 3, its new value is 5.) The macro returns to the beginning of the loop and runs, with the variable in the Control Variable parameter containing the new value. If the TerminateExp parameter is false, the macro goes to the command after ENDFOR and continues from that point. The steps remain the same every time through the loop, but the variable in the Control Variable parameter gets a new value from the IncrementExp parameter each time the loop runs.

Syntax

FOR (ControlVariable; InitialValue; TerminateExp; IncrementExp)

Parameters

ControlVariable
Any variable is valid for this parameter. The variable is incremented by the IncrementExp parameter each time the FOR-ENDFOR statement executes.
InitialValue
Specifies the initial value of the Control Variable parameter.
TerminateExp
Specifies the test against which the Control Variable parameter is compared.
IncrementExp
Specifies the increment of the Control Variable parameter.

Example

This macro creates a specific number of copies of one name and address. The user determines the number of copies to create.

GETNUMBER(Amount;"How many copies would you like?";"LABELS")
        FOR(Count;1;Count<=Amount;Count+1)
Type("Brad Simmons")
HardReturn
Type("1726 South Main Street")
HardReturn
Type("Orem, UT  84059")
HardPageBreak
        ENDFOR

See Also

FOREACH

FOREACH is the opening command of a FOREACH-ENDFOR conditional loop. A FOREACH loop executes all commands between FOREACH and ENDFOR. The number of times this loop executes depends on the number of items specified between the braces ({}). For example, if the command contains four Item parameters, the loop runs four times. Each time the loop executes, the next item is assigned to the variable specified in the Variable parameter. When the variable contains the value of the last item, the loop executes a final time. The macro then proceeds to the command immediately following ENDFOR and resumes.

Syntax

FOREACH(Variable;{Item1;Item2;...ItemN})

Parameters

Variable
Any variable is valid for this parameter. The variable specified here will contain the first item, and is replaced by the next item with each repetition of the loop.
Item
A character expression, numeric expression, or measurement expression specifying the item to assign to the variable.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

FORNEXT

FORNEXT is the opening command of a FORNEXT-ENDFOR conditional loop. The FORNEXT command begins a loop which executes all commands between the FORNEXT and its corresponding ENDFOR a specific number of times. The commands between FORNEXT and ENDFOR are executed until the Variable parameter exceeds the Stop parameter. When the loop has executed the specified number of times, the macro proceeds to the command immediately following ENDFOR and resumes.

Syntax

FORNEXT(Variable;Start;Stop;Step)

Parameters

Variable
Any variable is valid for this parameter. The variable specified here initially contains the value of the Start parameter, and will be replaced by an incremented (or decremented) value with each repetition of the loop.
Start
A numeric expression or a measurement expression specifying the initial value of the loop.
Stop
A numeric expression or a measurement expression specifying the value to terminate the loop.
Step (optional)
A numeric expression or a measurement expression specifying the value with which to increment the Variable parameter. If this parameter is not specified, the Variable parameter is incremented (or decremented) by a value of 1.

Example

This macro creates a user-specified number of labels.

Display(Off!)
GETNUMBER(tot;"How many return address labels would you like?")

FORNEXT(cnt;1;tot;1)
        Type("Your name")
 HardReturn
 Type("Your company")
 HardReturn
 Type("Your address")
 HardReturn
 Type("City, State  ZIP")
 HardPageBreak
ENDFOR

See Also

FRACTION

FRACTION returns the fractional portion of a numeric expression. For example, since the quotient of 3/2 is 1.5, FRACTION(3/2) returns the value 0.5. This command is generally used in conjunction with commands such as IF, ASSIGN, or Type.

Syntax

FRACTION(Number)

Parameters

Number
A numeric expression specifying the number to evaluate. This numeric expression often contains a mathematical operation such as division.

Example

This macro prompts for a numerator followed by a denominator and performs the division of the two numbers. The macro returns the integer value of the nearest whole number.

DISPLAY(Off!)
GETNUMBER(num1;"Enter the numerator")
GETNUMBER(num2;"Enter the denominator")
x:=FRACTION(num1/num2)
y:=INTEGER(num1/num2)
        IF(x>=0.5)
          num:=y+1
        ELSE
          num:=y
        ENDIF
Type(num)

See Also

FUNCTION

FUNCTION is the opening command for a FUNCTION-ENDFUNC definition. A FUNCTION is a subroutine to which you can pass information and from which you can receive information. FUNCTION defines the function name and the parameter names as well as includes a series of commands to be executed when the FUNCTION is called. A RETURN command is used in the FUNCTION to return the result of the function operation. If RETURN is not used, the FUNCTION will return a value of 0. Commands after an ENDFUNC are ignored, so all FUNCTIONs should be placed at the end of a macro. Also, a FUNCTION cannot be defined within another FUNCTION definition.

Creating and calling FUNCTIONs is much like creating, filling in, and executing your own macro commands. The function name is comparable to a command name and the parameter names represent aspects of the FUNCTION that can be manipulated. For example, you could create a FUNCTION that returns the average of six numbers. The sequence of commands would look like this:

FUNCTION Avg(N1;N2;N3;N4;N5;N6)
Sum=N1+N2+N3+N4+N5+N6
Average=Sum/6
RETURN(Average)
ENDFUNC

Notice that the FUNCTION name is Avg and that the parameters do not contain any information; they are simply "holding places" for number one, number two, etc.. The actual numbers to fill in the parameters will be passed when the FUNCTION is called. The RETURN command returns the contents of variable Average to the location from which the FUNCTION is called.

To call a FUNCTION, you simply state the function name and fill in the parameters. You must pass the same number of parameters as originally defined in the FUNCTION. Since the FUNCTION can return information, it must be called from within a command or statement that can evaluate its contents or perform an action such as IF, ASSIGN, or Type. For example, to call FUNCTION Avg and type the average of the six numbers passed to it, the command is:

Type(Avg(4;10;65;9;11;47))

FUNCTIONs can be in the macro from which they are called, in another macro, or they can be combined into a macro file library. This library is a macro that doesn't execute, but simply contains FUNCTIONs that may be useful in many macros. If a FUNCTION isn't defined in the macro that calls it, the USE command must be placed in the calling macro to identify which macro contains the FUNCTION. If you are storing FUNCTIONs in a macro file library, the file must be compiled before it can be used. To compile, simply play the macro.

Syntax

FUNCTION Name(Parameter1;Parameter2;...ParN)

Parameters

Function Name
Specifies the FUNCTION name. Although this parameter is usually text, it is not considered a character expression and should not be in quotes.
Parameter (optional)
Specifies the parameter names to which information will be passed when the FUNCTION is called. If no parameters are specified, The FUNCTION can still be called, executed, and evaluated.

Example

This macro executes a Function from within a Type command.

Prmt:="Would you like to continue?"
Type ("You pressed "+YesNo(prmt))

                //More code for the macro could be inserted here
Quit

FUNCTION YesNo (message)
LOCAL(ans)
LABEL(Begin)
CHAR(ans;message+"  Y/N")
        SWITCH(TOLOWER(NTOC(ans)))
CASEOF "y" : ans:="Y"
CASEOF "n" : ans:="N"
DEFAULT    : GO(Begin)
        ENDSWITCH
RETURN(ans)
ENDFUNC

See Also

GETNUMBER

GETNUMBER displays a dialog box in which the user enters a numeric expression. When the dialog box displays, the macro pauses and allows the user to enter in a number. The number is then assigned to the variable specified in the Variable parameter. If the user enters a keystroke other than a number, the value of 0 is assigned to the variable.

Syntax

GETNUMBER(Variable;Prompt;Title)

Parameters

Variable
Any variable is valid for this parameter. The variable contains the number entered by the user.
Prompt (optional)
A character expression specifying the prompt in the dialog box.
Title (optional)
A character expression specifying the title of the dialog box.

Example

This macro creates a user-specified number of labels.

Display(Off!)
GETNUMBER(tot;"How many return address labels would you like?")

FORNEXT(cnt;1;tot;1)
        Type("Your name")
 HardReturn
 Type("Your company")
 HardReturn
 Type("Your address")
 HardReturn
 Type("City, State  ZIP")
 HardPageBreak
ENDFOR

See Also

GETSTRING

GETSTRING displays a dialog box in which the user enters a character expression. When the dialog box displays, the macro pauses while the user types in text. If the optional Length parameter is specified, the dialog box prevents the user from entering more text than the number of characters specified. The text is assigned to the variable specified in the Variable parameter.

Syntax

GETSTRING(Variable;Prompt;Title;Length)

Parameters

Variable
Any variable is valid for this parameter. The variable contains the text typed in by the user.
Prompt (optional)
A character expression specifying the prompt in the dialog box.
Title (optional)
A character expression specifying the title of the dialog box.
Length (optional)
A numeric expression specifying, in characters, the maximum amount of text allowed.

Example

This macro prompts for a character and returns its numeric equivalent.

GETSTRING(num;"Enter a character:")
numequiv:=CTON(num)
PROMPT("The numeric equivalent of "+num+" is "+numequiv+".")
PAUSE

See Also

GETUNITS

GETUNITS displays a dialog box in which the user enters a measurement expression and, optionally, a unit of measurement character (",i,u,p). When the dialog box displays, the macro pauses while the user types in a measurement. If no character is specified, the macro will use the default unit of measurement.

Syntax

GETUNITS(Variable;Prompt;Title)

Parameters

Variable
Any variable is valid for this parameter. The variable contains the measurement entered by the user.
Prompt (optional)
A character expression specifying the prompt in the dialog box.
Title (optional)
A character expression specifying the title of the dialog box.

Example

This macro prompts for and sets top and bottom margins.

SAVESTATE
AutoCodePlacement(On!)
SetupSave
GETUNITS(margint;"Enter top margin";"Margin")
GETUNITS(marginb;"Enter bottom margin";"Margin")
MarginTop(margint)
MarginBottom(marginb)

See Also

GLOBAL

GLOBAL specifies variables to be used in the current macro, in FUNCTIONs or PROCEDUREs of the current macro, or in chained or nested macros.

Syntax

GLOBAL(Var1;Var2;...VarN)

Parameters

Variable
Any variable is valid for this parameter.

Example

This macro prompts for a file to retrieve. It then calls a Procedure to retrieve the file.

GLOBAL(Path;Filename)

LABEL(Begin)
GETSTRING(Path;"Enter the Path of the file to retrieve.")
GETSTRING(Filename;"Enter the filename to retrieve.")
Retrieve()              //calls the procedure Retrieve
ERROR(Off!)
        IF(?Name="")
GO(Begin)
        ENDIF

QUIT

PROCEDURE Retrieve()
        ONERROR CALL(Error)
        FileRetrieve(Path+Filename)
ENDPROC

LABEL(Error)
INPUT("The File doesn't exist.  Press Enter to continue")
RETURN

See Also

GO

GO redirects macro execution to the label specified in the Label parameter.

Syntax

GO(Label)

Parameters

Label
Specifies the label to which the macro should be directed. The specified label must match a label specified by a LABEL command elsewhere in the macro.

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

IF

IF is the opening command of an IF-ENDIF conditional statement. An IF statement permits the execution of a series of commands only if certain conditions exist. The IF command contains a relational expression that can be evaluated as true or false. For example, NUMBER>28 is a relational expression that could be either true or false depending on the value of variable NUMBER.

When an IF expression is true, the commands directly after IF are executed. When an expression is false, the macro proceeds directly to the ENDIF command and resumes. To execute certain commands only when the IF expression is false, use ELSE.

Syntax

IF(Test)

Parameters

Test
A relational expression specifying the condition to evaluate.

Example

This macro prints the current document path and filename in a footer.

IF(?Name<>"")
        FooterB(Create!)
        TYPE(?Path+?Name)
        SubstructureExit
ELSE
        PROMPT("The file hasn't been saved yet.  Please save and re-run the macro.")
        PAUSE
ENDIF

See Also

IFPLATFORM

IFPLATFORM specifies the platform on which the commands contained between IFPLATFORM and ENDIFPLATFORM will run. Commands contained in an IFPLATFORM statement are ignored by all platforms not specified in the Platform Identifier parameter. This allows a macro to be written for, and executed in, programs running on different platforms. Each platform requires a specific identifier. For example, DOS requires DOS and Windows requires WIN. The identifiers are not case sensitive and multiple platforms can be specified. If multiple platforms are specified, the commands between IFPLATFORM and ENDIFPLATFORM must be valid on each platform for the macro to execute properly.

Syntax

IFPLATFORM (PlatformId;...PlatformId)

Parameters

PlatformId
Specifies the platforms on which subsequent macro commands are recognized. The following values are valid for this parameter:

Example

This macro executes in either Corel WordPerfect 6.2 for DOS or Corel WordPerfect 6.0/6.1 for Windows. It nests or runs the appropriate macro for each application. The macros MEMO.WPM and WPMAIL.WCM must have already been created.

IFPLATFORM("DOS")
        //This code will only execute when run in Corel
        //WordPerfect 6.2 for DOS
        NEST("c:\corel\wp62\macros\Memo.wpm")
ENDIFPLATFORM

IFPLATFORM("WIN")
    //This code will only execute in Corel WordPerfect
    //6.1 for Windows.
APPLICATION(A1; "WordPerfect"; Default; "US")
            RUN("c:\wpwin61\macros\WPMail.wcm")
        ENDIFPLATFORM

See Also

INDIRECT

INDIRECT returns the contents of the specified variable. INDIRECT allows the variable name to be concatenated through any combination of character expressions, numeric expressions, or existing variables. This command is used in conjunction with other commands such as IF or Type.

For Example:

S1="New York"
S2="Georgia"
S3="Oregon"

FORNEXT(A;1;3;1)
Type("The state of ")
Type(INDIRECT("S"+A))
Hardreturn
ENDFOR

In this example, INDIRECT creates the variable names S1, S2, and S3 by concatenating the character expression "S" and the variable A. The variable names have been created indirectly in the FORNEXT loop to eliminate the need to request them individually.

Syntax

INDIRECT(Variable)

Parameters

Variable
A combination of character expressions, numeric expressions, or variables specifying the variable name.

Example

This macro averages a series of numbers and returns the quotient value of the average.

ASSIGN(Last;0)
GETNUMBER(HowMany;"How many numbers do you have to average")
ASSIGN(Y;0)

FORNEXT(Count;1;HowMany)
        GETNUMBER(INDIRECT("Number"+Count);"Enter in a number  ")
        ASSIGN(last;last+Indirect("Number"+Count))
ENDFOR

Type("The quotient of the average of ")

FORNEXT(X;1;HowMany)
        TYPE(Indirect("Number"+x)+"+")
ENDFOR

DeleteCharPrevious

Type(" is "+last DIV howmany)

See Also

INPUT

INPUT displays a prompt, pausing the macro while the user enters any necessary keystrokes. The macro remains paused until the user presses Enter or the command specified in the last PAUSESET. This command is similar to using PROMPT and PAUSE together. However, the PROMPT message is removed from the screen as soon as any key is pressed. INPUT is also similar to using STATUSPROMPT and PAUSE together. However, the STATUSPROMPT message is removed only by a blank STATUSPROMPT or by a blank INPUT.

Syntax

INPUT(Prompt)

Parameters

Prompt
A character expression specifying the prompt to display.

Example

This macro prompts for a file to retrieve. It then calls a Procedure to retrieve the file.

GLOBAL(Path;Filename)

LABEL(Begin)
GETSTRING(Path;"Enter the Path of the file to retrieve.")
GETSTRING(Filename;"Enter the filename to retrieve.")
Retrieve()              //calls the procedure Retrieve
ERROR(Off!)
        IF(?Name="")
GO(Begin)
        ENDIF

QUIT

PROCEDURE Retrieve()
        ONERROR CALL(Error)
        FileRetrieve(Path+Filename)
ENDPROC

LABEL(Error)
INPUT("The File doesn't exist.  Press Enter to continue")
RETURN

See Also

INTEGER

INTEGER returns the integer portion of the specified numeric expression. For example, INTEGER(43/2) returns the value of 21. The fractional portion (0.5) is ignored. This command is generally used in conjunction with such commands as IF, ASSIGN, or Type.

Syntax

INTEGER(Number)

Parameters

Number
A numeric expression specifying the number to evaluate. This numeric expression often contains a mathematical operation such as division.

Example

This macro prompts for a numerator followed by a denominator and performs the division of the two numbers. The macro returns the integer value of the nearest whole number.

DISPLAY(Off!)
GETNUMBER(num1;"Enter the numerator")
GETNUMBER(num2;"Enter the denominator")
x:=FRACTION(num1/num2)
y:=INTEGER(num1/num2)
        IF(x>=0.5)
                num:=y+1
        ELSE
                num:=y
        ENDIF
Type(num)

See Also

LABEL

LABEL marks a specific location, sometimes called a subroutine, in a macro. Execution can be directed to that location from anywhere in the macro using commands such as CALL, GO, ONCANCEL, ONERROR, and ONNOTFOUND.

A macro can contain an unlimited number of LABEL commands, but each label must have a unique name. Label names cannot include spaces or be longer than thirty characters.

Syntax

LABEL(Label Name)

Parameters

Label Name
Specifies the label name. Although the name usually consists of text, it is not considered a character expression and should not be enclosed in quotation marks.

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

LOCAL

LOCAL ensures that a variable is local to a FUNCTION, PROCEDURE, or macro. Once the PROCEDURE, FUNCTION, or macro has executed, the local variables are discarded from memory and are no longer available.

Syntax

LOCAL(Var1;Var2;...VarN)

Parameters

Variable
Any variable is valid for this parameter.

Example

This macro executes a Function from within a Type command.

Prmt:="Would you like to continue?"
Type ("You pressed "+YesNo(prmt))

                        //More code for the macro could be inserted here
Quit

FUNCTION YesNo (message)
LOCAL(ans)
LABEL(Begin)
CHAR(ans;message+"  Y/N")
        SWITCH(TOLOWER(NTOC(ans)))
CASEOF "y" : ans:="Y"
CASEOF "n" : ans:="N"
DEFAULT    : GO(Begin)
        ENDSWITCH
RETURN(ans)
ENDFUNC

See Also

LOOK

LOOK evaluates whether a key was pressed by the user. If a key has been pressed, the numeric equivalent of the key is assigned to the variable specified in the Variable parameter. If a key has not been pressed, the content of the variable is assigned the value of 0 and the macro continues. LOOK is most useful in macros that execute certain commands only if a specific key is pressed. This command is used in conjunction with commands designed to evaluate expressions such as SWITCH, IF, or REPEAT. For a list of the keys and their numeric equivalents, see Appendix A: Keystroke Numeric Equivalents.

Syntax

LOOK(Variable)

Parameters

Variable
Specifies the variable to contain the numeric equivalent of the key.

Example

This macro counts keystrokes until the user presses Ctrl-Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

MENULIST displays a dialog box containing the specified menu items. The items displayed in the dialog box are numbered automatically. The number of the item selected by the user is assigned to the variable specified in the Variable parameter. Once the variable has been assigned, it can be evaluated with such commands as IF or SWITCH.

Syntax

MENULIST(Variable;{Item1;Item2;...ItemN};Title;Horizontal Position;Vertical Position)

Parameters

Variable
Any variable is valid for this parameter. The variable contains the number of the selected item.
Item
A character expression specifying the item.
Title (optional)
A character expression specifying the title of the dialog box.
Horizontal Position (optional)
A numeric expression specifying the horizontal position of the dialog box. If this parameter is not specified, the dialog will be centered.
Vertical Position (optional)
A numeric expression specifying the vertical position of the dialog box. If this parameter is not specified, the dialog will be centered.

Example

This macro displays a menu from which the user chooses to whom they are writing a letter.

Type("Dear ")
MENULIST(choice;{"Corel, Inc.";"Mom and Dad";"President of the US"})
        SWITCH(choice)
CASEOF 1 : Type("Customer Support")
CASEOF 2 : Type("Mom and Dad")
CASEOF 3 : Type("Mr. President")
        ENDSWITCH
Type(",")
HardReturn

See Also

NEST

NEST temporarily transfers control from the current macro to another macro. The transfer occurs when this command is encountered in the current macro. When the nested macro is complete, control returns to the parent macro and continues.

Syntax

NEST(Macro)

Parameters

Macro
A character expression specifying the macro to nest. The path and .WPM extension are optional.

Example

This macro nests a macro RTRN_ADD.WPM which types a user's return address. It then allows the user to fill in the inside address and salutation.

NEST("rtrn_add.wpm")

HardReturn
HardReturn

STATUSPROMPT("Enter the inside address and press F9 to continue")
PAUSECOMMAND(EndField)

HardReturn
HardReturn
Type("Dear ")

STATUSPROMPT("Enter the salutation and press Enter")
PAUSE
STATUSPROMPT("")

Type(",")
HardReturn
HardReturn

See Also

NEXT

NEXT executes the next cycle or iteration of a FORNEXT, FOREACH, WHILE, or REPEAT loop. Usually the ENDFOR, ENDWHILE, or UNTIL command ends the current iteration and directs execution to the beginning of the loop to start the next iteration. NEXT sends execution to the next iteration from a location other than at the end of the loop. For example, you might use nested IF statements as part of the loop and if a specific condition exists, NEXT causes the remaining commands to be ignored and the loop proceeds directly to the next iteration.

Syntax

NEXT

Example

This macro parses an array and displays the student name and grade.

student[1]:="Mark B.  PE 132  A"
student[2]:="Kerry R.  Physics 305  B"
student[3]:="Ralph D.  CS 351  A"
student[4]:="John B.  Math 402  B"

FORNEXT(x;1;4;1)
        len:=STRLEN(student[x])
        namepos:=STRPOS(student[x];" ")

IF((len=0) OR (namepos=0))
        NEXT
ENDIF

        name:=SUBSTR(student[x];1;namepos-1)
        grade:=SUBSTR(student[x];len;1)
        Type(name)

FORNEXT(space;1;15-namepos;1)
        Type(" ")
ENDFOR

        Type(grade)
        HardReturn
ENDFOR

See Also

NOT

NOT is an operator that evaluates an expression in a conditional statement and/or returns the complement of an expression. This command performs a logical NOT. Use NOT when you want the conditional statement to be evaluated as true only if the complement of the expression is true, in other words, NOT true means it is false. This operator is used in conjunction with such commands as IF, REPEAT, and WHILE.

Syntax

NOT

Example

This macro places the path and filename of the current document in a header.

Header := 1=1           //This assigns the variable Header
                                //a boolean value of TRUE.

ONNOTFOUND CALL(Assign)

PosDocVeryTop
SearchString("[Header A]")
SearchNext()

IF(NOT Header)
        HeaderA(Create!)
ELSE
        HeaderA(Edit!)
ENDIF

HardReturn
Type(?Path+?Name)
SubstructureExit
QUIT

LABEL(ASSIGN)
        Header := 1=0           //This assigns the variable Header
RETURN                                  //a boolean value of FALSE.

See Also

NOTFOUND

NOTFOUND determines whether to ignore a Not Found condition during macro execution. A Not Found condition most commonly occurs when a search fails. By default, Not Found conditions are not ignored and will generally stop the macro. NOTFOUND can also be used to redirect macro execution with ONNOTFOUND. If an ONNOTFOUND command occurs in the macro before a Not Found condition occurs, the macro is redirected to the label specified by ONNOTFOUND.

Syntax

NOTFOUND(State)

Parameters

State
Specifies whether to ignore a Not Found. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Ignore Not Found
On! 1 Do not ignore Not Found

Example

This macro places the path and filename of the current document in a header.

Header := 1=1           //This assigns the variable Header
                                        //a boolean value of TRUE.
NOTFOUND(On!)
ONNOTFOUND CALL(Assign)

PosDocVeryTop
SearchString("[Header A]")
                                //[Header A] is a code that must be
                                //recorded in another macro, then copied
                                //into this one.  It cannot simply be
                                //typed in.
SearchNext()

IF(NOT Header)
        HeaderA(Create!)
ELSE
        HeaderA(Edit!)
ENDIF

HardReturn
Type(?Path+?Name)
SubstructureExit
QUIT

LABEL(ASSIGN)
        Header := 1=0           //This assigns the variable Header
RETURN                                  //a boolean value of FALSE.

See Also

NTOC

NTOC (Number To Character) converts a Corel WordPerfect key value or character set number to its character equivalent. The number is equal to the character set number multiplied by 256 plus the character number. For example, Ç is character 38 in Character Set 1. Multiply 256 times 1 (256), then add 38 (294). The NTOC of 294 is Ç. NTOC returns an empty string ("") if a number is used which has no character equivalent.

Syntax

NTOC(Number)

Parameters

Number
A numeric expression specifying the number to convert.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        TYPE(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

NUMSTR

NUMSTR converts a numeric expression or a measurement expression to a character expression. Numbers converted with NUMSTR are regarded as text by the macro. This command is used in combination with commands that evaluate expressions such as ASSIGN or Type.

Syntax

NUMSTR(Number;Right Digits;Exponential Notation)

Parameters

Number
A numeric or measurement expression specifying the number to convert.
Right Digits (optional)
A numeric expression specifying the number of digits to the right of the decimal.
Exponential Notation (optional)
A numeric expression specifying the number of digits to the left of the decimal to accept before converting to exponential notation. If the number specified in the Number parameter contains more digits to the left of the decimal than specified here, the number will convert to exponential notation.

Example

This macro defines page numbering in the format Current of Total (1 of 5).

DISPLAY(Off!)
PosDocBottom
TotPgNum:=?page
PosDocTop
TotPgStr:=NUMSTR(TotPgNum)
PageNumberPosition(BottomCenter!;UseDefaultValues!)
PageNumberFormat("[page #] of"+TotPgStr)
        //[page #] is a code that must be recorded in a separate
        //macro, then copied into this one.  It cannot simply be
        //typed in

See Also

ONCANCEL

ONCANCEL directs macro execution to the specified LABEL command when a Cancel occurs. If an ONCANCEL command has not been encountered when a Cancel occurs, the macro will stop. If a Cancel occurs after two or more ONCANCEL commands, the macro is directed to the LABEL command specified in the last encountered ONCANCEL command in the active macro.

ONCANCEL also includes the option of calling a LABEL if you use ONCANCEL CALL. This option of ONCANCEL can also call a PROCEDURE. If you call a LABEL, include a RETURN command at the end of the commands to be executed by the specified LABEL. This returns the macro execution to the command immediately following the command most recently executed when the Cancel occurred.

Syntax

ONCANCEL(Label)

or

ONCANCEL CALL (Label)

Parameters

Label
The label must correspond to a LABEL command within the macro. If using ONCANCEL CALL, this parameter can be a PROCEDURE.

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        TYPE(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

ONERROR

ONERROR directs macro execution to the specified LABEL command when an Error occurs. If ONERROR has not been encountered when an Error occurs, the macro will stop. If an Error occurs after two or more ONERROR commands, the macro is directed to the LABEL command specified in the last encountered ONERROR command in the active macro.

ONERROR also includes the option of calling a LABEL if you use ONERROR CALL. This option of ONERROR can also call a PROCEDURE. If you call a LABEL, include a RETURN command at the end of the commands to be executed by the specified LABEL. This will return the macro execution to the command immediately following the command most recently executed when the Error occurred.

Syntax

ONERROR(Label)

or

ONERROR CALL (Label)

Parameters

Label
The label must correspond to a LABEL command within the macro. If using ONERROR CALL, this parameter can be a PROCEDURE.

Example

This macro prompts the user to highlight text in a document. The macro then assigns the text to a variable.

Display(On!)

ONERROR(error)

LABEL(Begin)
BlockKey
PROMPT("Highlight the text to assign to a variable and press Enter")
PAUSE
x:=?BlockedText

IF (x="")
        ASSERT(ErrorCondition!)
ENDIF
        //place more code here to make this macro more functional
QUIT

LABEL(Error)
BEEP
DisplayRewrite
PROMPT("You must select text to assign it to a variable")
PAUSE
GO(Begin)

See Also

ONNOTFOUND

ONNOTFOUND directs macro execution to a specified LABEL command when a Not Found condition occurs. Macro execution is directed to the LABEL command specified in the last encountered ONNOTFOUND command. If an ONNOTFOUND command has not been encountered when a Not Found condition occurs, the macro will stop.

ONNOTFOUND also includes the option of calling a LABEL if you use ONNOTFOUND CALL. This option of ONNOTFOUND can also call a PROCEDURE. If you call a LABEL, include a RETURN command at the end of the commands to be executed by the specified LABEL. This will return the macro execution to the command immediately following the command most recently executed when the Not Found occurred.

Syntax

ONNOTFOUND(Label)

or

ONNOTFOUND CALL (Label)

Parameters

Label
The label must correspond to a LABEL command within the macro. If using ONNOTFOUND CALL, this parameter can be a PROCEDURE.

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

OR

OR is an operator that evaluates at least two expressions in a conditional statement. Conditional statements are created with commands such as IF, REPEAT, and WHILE. This operator performs a logical OR that evaluates a conditional statement as true if at least one expression is true.

Example

This macro parses an array and displays the student name and grade.

student[1]:="Mark B.  PE 132  A"
student[2]:="Kerry R.  Physics 305  B"
student[3]:="Ralph D.  CS 351  A"
student[4]:="John B.  Math 402  B"

FORNEXT(x;1;4;1)
        len:=STRLEN(student[x])
        namepos:=STRPOS(student[x];" ")

IF((len=0) OR (namepos=0))
        NEXT
ENDIF

        name:=SUBSTR(student[x];1;namepos-1)
        grade:=SUBSTR(student[x];len;1)
        Type(name)

FORNEXT(space;1;15-namepos;1)
        Type(" ")
ENDFOR

        Type(grade)
        HardReturn
ENDFOR

See Also

PAUSE

PAUSE pauses a macro until Enter is pressed while in a document or the command specified in PAUSESET is pressed. This command enables the user to type text or press keystrokes as if there were no macro running. PAUSE does not prompt the user so this command is generally used in conjunction with PROMPT, STATUSPROMPT, or BEEP.

Syntax

PAUSE

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

PAUSECOMMAND

PAUSECOMMAND pauses a macro until the user executes the specified command. PAUSECOMMAND does not prompt the user, so this command is generally used in conjunction with PROMPT, STATUSPROMPT, or BEEP.

Syntax

PAUSECOMMAND(Command)

Parameters

Command
A macro command specifying the command to end the pause. Any product command is valid for this parameter, but a command such as HardReturn would be the most common.

Example

This macro nests a macro RTRN_ADD.WPM which types a user's return address. It then pauses while the user fills in the inside address and salutation. The macro pauses at these points until the user presses F9.

NEST("rtrn_add.wpm")

HardReturn
HardReturn

STATUSPROMPT("Enter the inside address and press F9 to continue")
PAUSECOMMAND(EndField)

HardReturn
HardReturn
Type("Dear ")

STATUSPROMPT("Enter the salutation and press Enter")
PAUSE
STATUSPROMPT("")

Type(",")
HardReturn
HardReturn

See Also

PAUSEKEY

PAUSEKEY pauses a macro until the specified key is pressed. PAUSEKEY does not prompt the user so this command is generally used in conjunction with PROMPT, STATUSPROMPT, or BEEP.

Syntax

PAUSEKEY(Key Name)

Parameters

Key Name
Specifies the key to end a pause. There are specific key names assigned to each key. For a list of the key names see Appendix B: Key Names (PAUSEKEY).

Example

This macro beeps and displays a message if the current document is blank.

DISPLAY(Off!)
IF(?DocBlank)
        BEEP
        DISPLAY(On!)
        PROMPT("The document is blank.  Press Tab to continue")
        PAUSEKEY(TabKey)
        DISPLAY(Off!)
        QUIT
ENDIF

See Also

PAUSESET

PAUSESET specifies the default key for PAUSE and INPUT. The key specified in PAUSESET replaces a HardReturn (pressing Enter) as the keystroke that ends a pause.

Syntax

PAUSESET(Command)

Parameters

Command
A macro command specifying the command to end the pause. Any product command is valid for this parameter, but product commands designed to execute a keystroke (such as EndFieldKey) are the most common.

Example

This macro counts keystrokes until the user presses Ctrl-Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

PERSIST

PERSIST allows the specified variables to be recognized and accessed by other macros, FUNCTIONS, PROCEDURES, and merges. Normally, variables are only recognized, and can only be used, by the macro in which they are defined. PERSIST allows variables to be shared among macros during the present session of Corel WordPerfect. Variables Var0 through Var9 persist automatically. All other variables require this command to persist.

Syntax

PERSIST(Variable1;Variable2;...VariableN)

Parameters

Variable
Any variable is valid for this parameter.

Example

This macro checks to see if a typist's initials are assigned to the variable init. If the initials are not stored in a variable in memory, this macro assigns them to a variable. If they are, this macro prompts the user to see if the initials are correct. The merge files this macro runs must have already been created for the macro to execute properly.

IF(EXISTS(init))
        LABEL(again)
        CHAR(ans;"Are the typist's initials """+init+""" (y/n)")

SWITCH(TOUPPER(NTOC(ans)))
        CASEOF  "N" :  PERSIST(init)
        GETSTRING(init;"Enter the typist's initials.")
        CASEOF  "Y" :  BREAK
        DEFAULT     :  GO(again)
ENDSWITCH
ELSE
        PERSIST(init)
        GETSTRING(init;"Enter the typist's initials.")
ENDIF

MergeRun(FormFile!;"memo.frm";FormFile!;;ToNewDoc!)

See Also

PERSISTALL

PERSISTALL allows all variables in the current macro to be recognized and accessed by other macros, FUNCTIONS, PROCEDURES, and merges during the present session of Corel WordPerfect. This command takes effect when it is encountered, so only those variables defined after this command will be available to other macros. Variables Var0 through Var9 persist automatically.

Syntax

PERSISTALL

Example

This macro prompts the user for a return address and assigns it to a series of variables. It then makes the variables accessible until Corel WordPerfect is exited.

PERSISTALL
DLGCREATE(x;"Return Address";DLGNoCancel!;;;50;10)
DLGCONTROL(CtrlText!;name;"Name";StyInitial!;1;3;37;2)
DLGCONTROL(CtrlText!;address;"Street Address";;1;5;27;2)
DLGCONTROL(CtrlText!;c;"City, State ZIP ";;1;7;25;2)
DLGEND
PROMPT("All the variables are now accessible in any macro/merge.")
WAIT(50)

See Also

PRESSKEY

PRESSKEY executes the specified keystroke. Normally, PRESSKEY will execute the original function of a key even if the key has been remapped. If a key has been remapped through Keyboard Layout, you can use PRESSKEY in conjunction with the ?KeyPressed system variable to execute the new function of the key. For the list of keys and their numeric equivalents see Appendix A: Keystroke Numeric Equivalents.

Syntax

PRESSKEY(Key Value)

Parameters

Key Value
A numeric expression specifying the numeric equivalent of the keystroke to execute. This parameter can also contain the ?KeyPressed system variable.

Example

This macro takes the number returned by the CHAR command and presses the corresponding key.

CHAR(x;"Press a key: ")

IF(x<>?KeyPressed)              //***see comment at end of macro***
        PRESSKEY(?KeyPressed)   //activates the remapped key
ELSE
        Type(NTOC(x))           //activates the original key
ENDIF

//***The only time these two variables will not be the same is when the key pressed by the
user has been remapped in Keyboard Layout.***

See Also

PROCEDURE

PROCEDURE is the opening command for a PROCEDURE-ENDPROC routine. A PROCEDURE is a subroutine to which you can pass information. Unlike a FUNCTION, a PROCEDURE cannot return information. PROCEDURE defines the procedure name and the parameter names, and precedes the series of commands to be executed when the PROCEDURE is called. Commands after an ENDPROC are ignored, so all PROCEDUREs should be placed at the end of a macro.

Creating and calling a PROCEDURE is much like calling a LABEL. However, unlike a LABEL, information can be passed to a PROCEDURE to customize the procedure operation. If a PROCEDURE will use variables that have been assigned earlier in the macro, the variables must be made available to the PROCEDURE using GLOBAL or PERSIST.

To call a PROCEDURE, you simply state the procedure name and fill in the parameters. The parameters can contain any expression, including variables. You must pass the same number of parameters as originally defined in the PROCEDURE. Since a PROCEDURE cannot return information, it should not be called from within another command or conditional statement. Also, a PROCEDURE cannot be called from within another PROCEDURE.

PROCEDUREs can be in the macro from which they are called, in another macro, or combined into a macro file library. This library is a macro that doesn't execute, but simply contains PROCEDUREs that may be useful in many macros. If a PROCEDURE isn't defined in the macro that calls it, the USE command must be placed in the calling macro to identify which macro contains the PROCEDURE. If you are storing PROCEDUREs in a macro file library, the file must be compiled before it can be used. To compile, simply play the macro.

Syntax

PROCEDURE ProcedureName(Parameter1;Parameter2;...ParN)

Parameters

Procedure Name
Specifies the PROCEDURE name. Although this parameter is usually text, it is not considered a character expression and should not be in quotes.
Parameter (optional)
Specifies the parameter names to which information will be passed when the PROCEDURE is called. If no parameters are specified, the PROCEDURE can still be called and executed.

Example

This macro prompts for a file to retrieve. It then calls a Procedure to retrieve the file.

GLOBAL(Path;Filename)

LABEL(Begin)
GETSTRING(Path;"Enter the Path of the file to retrieve.")
GETSTRING(Filename;"Enter the filename to retrieve.")
Retrieve()              //calls the procedure Retrieve
ERROR(Off!)
        IF(?Name="")
GO(Begin)
        ENDIF

QUIT

PROCEDURE Retrieve()
        ONERROR CALL(Error)
        FileRetrieve(Path+Filename)
ENDPROC

LABEL(Error)
INPUT("The File doesn't exist.  Press Enter to continue")
RETURN

See Also

PROMPT

PROMPT displays a temporary prompt on the status line. The prompt is removed when a key is pressed or the display is rewritten. PROMPT does not pause the macro, so it is usually used with PAUSE or WAIT.

Syntax

PROMPT(Prompt)

Parameters

Prompt
A character expression specifying the prompt.

Example

This macro searches for a period (.) followed by two spaces and capitalizes the first letter of the next sentence.

DISPLAY(Off!)
PosDocTop
CALL(Convert)

ONNOTFOUND(NotFnd)

LABEL(Begin)
        SearchString(".  ")
        SearchNext
        CALL(Convert)
GO(Begin)

LABEL(Convert)
        BlockOn(CharMode!)
        PosCharNext
        ConvertCaseUppercase
        BlockOff
RETURN

LABEL(NotFnd)
        DISPLAY(On!)
        PROMPT("It's finished.  Press ENTER to continue.")
        PAUSE
        PosDocTop

See Also

QUIT

QUIT stops a macro. No commands following it are executed. If the current macro was started by another macro, both macros stop. Chained or nested macros will not execute after QUIT occurs.

Syntax

QUIT

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

REPEAT

REPEAT is the opening command of a REPEAT-UNTIL conditional loop. A REPEAT-UNTIL loop continues to execute all commands between REPEAT and UNTIL until the condition set in UNTIL is true. Since the condition is evaluated at the end, a REPEAT-UNTIL loop always executes at least once regardless of whether the UNTIL condition is true or false. For information on conditional loops whose test expressions are evaluated at the top of the loop, see WHILE and ENDWHILE.

Syntax

REPEAT

Parameters

There are no parameters, but REPEAT is always followed by commands to execute at least once.

Example

This macro counts keystrokes until the user presses Ctrl-Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

RETURN

RETURN marks the end of a series of commands initiated by LABEL, PROCEDURE, or FUNCTION. This command is usually used in conjunction with CALL. When RETURN is encountered, macro execution returns to the command immediately following the command that called the LABEL or PROCEDURE. If RETURN occurs within a FUNCTION, it also has the capability of returning information from the FUNCTION to the location from which it was called. RETURN is then followed by an expression enclosed in parentheses. The expression contains the value to return to the FUNCTION.

Syntax

RETURN or RETURN(Expression)

Parameters

Expression
Any expression is valid for this parameter. It is often a variable or a parameter name as defined by the FUNCTION to which it is returning.

Example

This macro executes a Function from within a Type command.

Prmt:="Would you like to continue?"
Type ("You pressed "+YesNo(prmt))

                        //More code for the macro could be inserted here
Quit

FUNCTION YesNo (message)
LOCAL(ans)
LABEL(Begin)
CHAR(ans;message+"  Y/N")
        SWITCH(TOLOWER(NTOC(ans)))
CASEOF "y" : ans:="Y"
CASEOF "n" : ans:="N"
DEFAULT    : GO(Begin)
        ENDSWITCH
RETURN(ans)
ENDFUNC

See Also

RUNUNATTENDED

RUNUNATTENDED allows a macro to continue running even if it encounters a situation that requires user input. Specifically, retrieving a password-protected file or trying to read from a disk drive not containing a disk both give error messages requiring action from the user. Normally, each of these situations will return an error that suspends macro execution until the user responds. However, if RUNUNATTENDED is used, the situation is cancelled (no response is necessary) and macro execution can be redirected with ONERROR. Without RUNUNATTENDED, the macro is suspended until the user responds to the problem.

Syntax

RUNUNATTENDED(State)

Parameters

State
Specifies whether critical problems are cancelled.
Enumerated Type Numeric Equivalent Description
Off! 0 Critical problems are not cancelled; response required
On! 1 Critical problems are cancelled; no response required

See Also

SAVESTATE

SAVESTATE saves the current state of certain Corel WordPerfect features. Should a macro change the state of these features, the original state is restored after the macro has executed. SAVESTATE automatically saves the current state of Auto Code Placement, Replace Confirm, and WP51 Cursor Movement.

Syntax

SAVESTATE

Example

This macro prompts for and sets top and bottom margins.

SAVESTATE
AutoCodePlacement(On!)
SetupSave
GETUNITS(margint;"Enter top margin";"Margin")
GETUNITS(marginb;"Enter bottom margin";"Margin")
MarginTop(margint)
MarginBottom(marginb)

SHELLASSIGN

SHELLASSIGN assigns an expression to a shell variable to be used in a Corel(R) Shell(TM) macro.

Syntax

SHELLASSIGN(Variable;Expression)

Parameters

Variable
Specifies the name of the variable to be assigned. Any variable name is valid for this parameter.
Expression
Specifies the expression to assign to the variable. All expressions are valid for this parameter.

Example

This macro takes a shell variable (which must have been previously assigned) and retrieves the respective file. The macro then places the path and filename in a footer, re-assigns the shell variable, and runs a Corel Shell macro named WPPRINT.SHM.

WPVar:=SHELLVARIABLE(Name)

FileRetrieve(WPVar)
FooterB(Create!)
Type(?Path+?Name)
SubstructureExit
path:=?path
FileSave(Path+"WP.PRN")

SHELLASSIGN(Name;"WP.PRN")
SHELLMACRO("C:\SH4O\MACROS\WPPRINT.SHM")

See Also

SHELLMACRO

SHELLMACRO runs the specified Corel Shell macro at the point this command is encountered. An .SHM extension is not required, and the path is necessary only if the macro is not located in the Local or System Macro Files directory specified in the Location of Files dialog box in Shell Setup.

Syntax

SHELLMACRO(Macro)

Parameters

Macro
A character expression specifying the Corel Shell macro to run.

Example

This macro takes a shell variable (which must have been previously assigned) and retrieves the respective file. The macro then places the path and filename in a footer, re-assigns the shell variable, and runs a Corel Shell macro named WPPRINT.SHM.

WPVar:=SHELLVARIABLE(Name)

FileRetrieve(WPVar)
FooterB(Create!)
Type(?Path+?Name)
SubstructureExit
path:=?path
FileSave(Path+"WP.PRN")

SHELLASSIGN(Name;"WP.PRN")
SHELLMACRO("C:\SH40\MACROS\WPPRINT.SHM")

See Also

SHELLVARIABLE

SHELLVARIABLE returns the contents of a shell variable. Variable contents can either be typed, evaluated, or assigned to a Corel WordPerfect variable.

Syntax

SHELLVARIABLE(Variable)

Parameters

Variable
Specifies the name of the shell variable.

Example

This macro takes a shell variable (which must have been previously assigned) and retrieves the respective file. The macro then places the path and filename in a footer, re-assigns the shell variable, and runs a Corel Shell macro named WPPRINT.SHM.

WPVar:=SHELLVARIABLE(Name)

FileRetrieve(WPVar)
FooterB(Create!)
Type(?Path+?Name)
SubstructureExit
path:=?path
FileSave(Path+"WP.PRN")

SHELLASSIGN(Name;"WP.PRN")
SHELLMACRO("C:\SH40\MACROS\WPPRINT.SHM")

See Also

SHOWATTROFF

SHOWATTROFF turns off a character display attribute. This command is used in conjunction with SHOWTEXT to change the display attributes.

Syntax

SHOWATTROFF(Attribute)

Parameters

Attribute
Specifies the display attribute to turn off. SHOWATTROFF requires at least one Attribute parameter, but will accept as many as need to be turned off. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
ExtraLarge! 0 Turns off Extra Large
VeryLarge! 1 Turns off Very Large
Large! 2 Turns off Large
Small! 3 Turns off Small
Fine! 4 Turns off Fine
Superscript! 5 Turns off Superscript
Subscript! 6 Turns off Subscript
Outline! 7 Turns off Outline
Italics! 8 Turns off Italics
Shadow! 9 Turns off Shadow
Redline! 10 Turns off Redline
DoubleUnderline! 11 Turns off Double Underline
Bold! 12 Turns off Bold
Strikeout! 13 Turns off Strikeout
Underline! 14 Turns off Underline
SmallCaps! 15 Turns off Small Caps
Every! 16 Turns off every display attribute

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: ")
DisplayRewrite

See Also

SHOWATTRON

SHOWATTRON turns on a character display attribute. This command is used in conjunction with SHOWTEXT to change the display attributes of text being displayed.

Syntax

SHOWATTRON(Attribute;Attribute;...Atr)

Parameters

Attribute
Specifies the display attribute to turn on. SHOWATTRON requires at least one Attribute parameter, but will accept as many as need to be turned on. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
ExtraLarge! 0 Turns on Extra Large
VeryLarge! 1 Turns on Very Large
Large! 2 Turns on Large
Small! 3 Turns on Small
Fine! 4 Turns on Fine
Superscript! 5 Turns on Superscript
Subscript! 6 Turns on Subscript
Outline! 7 Turns on Outline
Italics! 8 Turns on Italics
Shadow! 9 Turns on Shadow
Redline! 10 Turns on Redline
DoubleUnderline! 11 Turns on Double Underline
Bold! 12 Turns on Bold
Strikeout! 13 Turns on Strikeout
Underline! 14 Turns on Underline
SmallCaps! 15 Turns on Small Caps
Every! 16 Turns on every display attribute

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: ")
DisplayRewrite

See Also

SHOWCODE

SHOWCODE positions displayed text and allows for other display changes. A SHOWCODE command affects the next occurrence of a SHOWTEXT command in the macro.

Syntax

SHOWCODE(Code)

Parameters

Code
Specifies the display change. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
PosHome! 0 Displays text at upper left of document window
PosNextLine! 1 Displays text on the next line
PosBegLine! 2 Displays text at the beginning of the current line
PosLeft! 3 Moves back to the last SHOWTEXT
PosRight! 4 Displays text two spaces to the right of the last SHOWTEXT
PosUp! 5 Displays text one line up from the last SHOWTEXT
PosDown! 6 Displays text one line down from the last SHOWTEXT
ClrLine! 7 Clears the line from the end of the last SHOWTEXT
ClrScreen! 8 Clears the screen
AttrNormal! 9 Clears all attributes
AttrMnemonic! 10 Turns on the Mnemonic attribute for the next character
ReverseOn! 11 Turns on Reverse Video
ReverseOff! 12 Turns off Reverse Video
SaveScreen! 13 Saves the screen
RestoreScreen! 14 Restores the screen

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: ")
DisplayRewrite

See Also

SHOWCOLOR

SHOWCOLOR turns a color scheme on or off.

Syntax

SHOWCOLOR(State;Scheme Name)

Parameters

State
Specifies whether the color scheme is on or off. Select an enumerated type or its numeric equivalent
Enumerated Type Numeric Equivalent Description
Off! 0 Turns off color scheme
On! 1 Turns on color scheme
Scheme Name (optional)
A character expression specifying the scheme name to turn on. Both user-defined and pre-defined Color Schemes are found by choosing File, Setup, Display, Text Mode Screen Type/Colors, Color Schemes. This parameter is not required when turning a scheme off.

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: ")
DisplayRewrite

See Also

SHOWPOSITION

SHOWPOSITION positions the cursor on the screen and, optionally, displays a temporary prompt. SHOWPOSITION does not pause the macro, so it is used in conjunction with such commands as PAUSE or WAIT.

Syntax

SHOWPOSITION(Horizontal Position;Vertical Position;Prompt)

Parameters

Horizontal Position
A numeric expression specifying the horizontal position of the prompt. This position is measured in columns, with 0 representing the first column at the left of the screen.
Vertical Position
A numeric expression specifying the vertical position of the prompt. This position is measured in lines, with 0 representing the first row at the top of the screen.
Prompt (optional)
A character expression specifying the prompt to display.

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: "y)
DisplayRewrite

See Also

SHOWTEXT

SHOWTEXT displays a temporary prompt a specified number of times. SHOWPOSITION does not pause the macro, so it is used in conjunction with commands such as PAUSE or WAIT.

Syntax

SHOWTEXT(Prompt;Count)

Parameters

Prompt
A character expression specifying the prompt to display.
Count (optional)
A numeric expression specifying the number of times to display the prompt. If this parameter is not specified, the prompt will display once.

Example

This macro displays a menu created with the Show commands.

SHOWPOSITION(0; -1)
SHOWCODE(ReverseOff!)
SHOWCOLOR(On!;"Corel WP Default")
SHOWCODE(ClrScreen!)
SHOWPOSITION(21;8)
SHOWTEXT("╔══════════════════════════╗")
SHOWPOSITION(21;9)  SHOWTEXT("║     Please select the    ║")
SHOWPOSITION(21;10) SHOWTEXT("║     desired recipient    ║")
SHOWPOSITION(21;11) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("1")  SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("F")
SHOWATTROFF(Bold!)  SHOWTEXT("red") SHOWTEXT("           ║")
SHOWPOSITION(21;12) SHOWTEXT("║        ")
SHOWATTRON(Bold!)   SHOWTEXT("2") SHOWATTROFF(Bold!)
SHOWTEXT(". ")      SHOWATTRON(Bold!) SHOWTEXT("M")
SHOWATTROFF(Bold!)  SHOWTEXT("ary") SHOWTEXT("           ║")
SHOWPOSITION(21;13) SHOWTEXT("║                          ║")
SHOWPOSITION(21;14)
SHOWTEXT("╚══════════════════════════╝")
SHOWPOSITION(1; 24)

CHAR(menu1;"Selection: ")
DisplayRewrite

See Also

SPEED

SPEED slows down macro commands that write to the screen. Macro speed is incremented in 100ths of a second. For example, to specify a macro to wait 1.5 seconds between commands, use SPEED(150). The default macro speed is SPEED(0) which allows no delay between commands. SPEED is useful for debugging macros or making demonstration macros.

Syntax

SPEED(100ths of a Second)

Parameters

100ths of a Second
A numeric expression specifying macro speed.

Example

This macro displays how the SPEED command slows down the execution of a macro.

FORNEXT(Count;1;20)
        Type("This is line "+Count+".")
        HRt
ENDFOR

SPEED(30)

FORNEXT(Count;1;20)
        Type("This is line "+Count+".")
        HRt
ENDFOR

See Also

STATUSPROMPT

STATUSPROMPT displays a prompt on the status line. The prompt is stored in memory much like a variable and will continue to display until it is replaced by another prompt using either INPUT or another STATUSPROMPT command. If the prompt is not replaced, it will remain visible until it is cleared by a blank INPUT or STATUSPROMPT or until you exit Corel WordPerfect. Blank INPUT and STATUSPROMPT commands must contain quotation marks, for example:

INPUT("") or STATUSPROMPT("")

STATUSPROMPT does not pause the macro. To pause the macro until a specific key or command is executed, use PAUSE, PAUSECOMMAND, or PAUSEKEY. To display the prompt for a specific amount of time, use WAIT.

Syntax

STATUSPROMPT(Prompt)

Parameters

Prompt
A character expression specifying the prompt to display.

Example

This macro counts keystrokes until the user presses Ctrl-Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

STEP

STEP executes a macro one step at a time and is useful for debugging macros. When STEP is turned on a dialog box offers debugging options. If you choose Step, the macro will execute the next command. Choosing List displays a list of all encountered variables and their contents. From this list you can choose which variable table to list (Local, Global, or Persistent). If you choose Run, the macro will begin executing and STEP will be turned off. Choosing Cancel will cancel STEP and macro execution.

Syntax

STEP(State)

Parameters

State
Specifies whether STEP is on. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Turns STEP off
On! 1 Turns STEP on

Example

This macro demonstrates how the STEP command works. The STEP command is mainly used for debugging purposes.

FORNEXT(Count;1;5)
Type("This is line "+Count+".")
HRt
ENDFOR

STEP(On!)

FORNEXT(Count;1;5)
Type("This is line "+Count+".")
HRt
ENDFOR

STRLEN

STRLEN returns the number of characters (length) of a character expression. This command is used in conjunction with commands that can evaluate its contents or perform an action such as IF, ASSIGN, or Type.

Syntax

STRLEN(String)

Parameters

String
A character expression or a variable containing a character expression to evaluate.

Example

This macro parses an array and displays the student name and grade.

student[1]:="Mark B.  PE 132  A"
student[2]:="Kerry R.  Physics 305  B"
student[3]:="Ralph D.  CS 351  A"
student[4]:="John B.  Math 402  B"

FORNEXT(x;1;4;1)
        len:=STRLEN(student[x])
        namepos:=STRPOS(student[x];" ")

IF((len=0) OR (namepos=0))
        NEXT
ENDIF

        name:=SUBSTR(student[x];1;namepos-1)
        grade:=SUBSTR(student[x];len;1)
        Type(name)

FORNEXT(space;1;15-namepos;1)
        Type(" ")
ENDFOR

        Type(grade)
        HardReturn
ENDFOR

See Also

STRNUM

STRNUM converts a character expression to a numeric expression. This command must be used in an expression and must be used in conjunction with commands that evaluate expressions, such as IF, ASSIGN or Type.

Syntax

STRNUM(String)

Parameters

String
A character expression specifying the text to convert.

Example

This macro takes the string 15 and displays it as a Number, Unit, and Unit String value.

Num:="15"
ASSIGN(Number;STRNUM(Num))
ASSIGN(Unit;STRUNIT(Num))
ASSIGN(UnitString;UNITSTR(Unit;Centimeters!))

Type("The Number value is "+ Number)
        HardReturn
Type("The Unit value is "+ Unit)
        HardReturn
Type("The Unit String value is "+ UnitString)
        HardReturn

See Also

STRPOS

STRPOS returns the position of a substring within an original string. For example, "Perfect" is a substring of "WordPerfect" and begins at the fifth character, or position. In this example, STRPOS returns a value of 5. This command is used in conjunction with commands that can evaluate its contents or perform an action such as ASSIGN, IF, or Type. If a substring is not found, STRPOS returns the value of 0.

Syntax

STRPOS(Original String;Substring)

Parameters

Original String
A character expression specifying the original string.
Substring
A character expression specifying the substring.

Example

This macro parses an array and displays the student name and grade.

student[1]:="Mark B.  PE 132  A"
student[2]:="Kerry R.  Physics 305  B"
student[3]:="Ralph D.  CS 351  A"
student[4]:="John B.  Math 402  B"

FORNEXT(x;1;4;1)
        len:=STRLEN(student[x])
        namepos:=STRPOS(student[x];" ")

IF((len=0) OR (namepos=0))
        NEXT
ENDIF

        name:=SUBSTR(student[x];1;namepos-1)
        grade:=SUBSTR(student[x];len;1)
        Type(name)

FORNEXT(space;1;15-namepos;1)
        Type(" ")
ENDFOR

        Type(grade)
        HardReturn
ENDFOR

See Also

STRUNIT

STRUNIT converts a character expression to a measurement expression. This command is used in conjunction with commands such as ASSIGN or Type.

Syntax

STRUNIT(String)

Parameters

String
A character expression specifying the text to convert.

Example

This macro takes the string 15 and displays it as a Number, Unit, and Unit String value.

Num:="15"
ASSIGN(Number;STRNUM(Num))
ASSIGN(Unit;STRUNIT(Num))
ASSIGN(UnitString;UNITSTR(Unit;Centimeters!))

Type("The Number value is "+ Number)
        HardReturn
Type("The Unit value is "+ Unit)
        HardReturn
Type("The Unit String value is "+ UnitString)
        HardReturn

See Also

SUBSTR

SUBSTR creates a substring from an existing string. For example, to create substring "Brad" from "Bradford", the command is SUBSTR("Bradford";1;4). The value 1 specifies beginning the substring at the first character or position of the original string. The value 4 represents extracting four consecutive characters, including the character at the beginning position, to create the substring.

SUBSTR is used in conjunction with commands that can evaluate its contents or perform an action such as ASSIGN, IF, and Type.

Syntax

SUBSTR(Original String;Beginning Position;Number of Characters)

Parameters

Original String
A character expression specifying the string from which to create a substring.
Beginning Position
A numeric expression specifying the number of characters from the left (or at what position) to begin the substring. This parameter will also accept negative numbers to specify a position beginning at the right.
Number of Characters
A numeric expression specifying the number characters (including the beginning position) to extract as the substring.

Example

This macro parses an array and displays the student name and grade.

student[1]:="Mark B.  PE 132  A"
student[2]:="Kerry R.  Physics 305  B"
student[3]:="Ralph D.  CS 351  A"
student[4]:="John B.  Math 402  B"

FORNEXT(x;1;4;1)
        len:=STRLEN(student[x])
        namepos:=STRPOS(student[x];" ")

IF((len=0) OR (namepos=0))
        NEXT
ENDIF

        name:=SUBSTR(student[x];1;namepos-1)
        grade:=SUBSTR(student[x];len;1)
        Type(name)

FORNEXT(space;1;15-namepos;1)
        Type(" ")
ENDFOR

        Type(grade)
        HardReturn
ENDFOR

See Also

SWITCH

SWITCH is the opening command for a conditional switch statement. A complete switch statement includes the following commands: SWITCH, CASEOF, CONTINUE (optional), DEFAULT (optional), and ENDSWITCH. A switch statement compares a single SWITCH expression against individual CASEOF expressions and executes specific commands depending on which CASEOF matches the SWITCH expression.

The SWITCH command contains an expression to evaluate. Any expression is valid, but it is usually a variable. In most cases, the contents of this variable are assigned earlier in the macro with commands such as CHAR or GETSTRING. This SWITCH expression is the "test" against which each individual case is compared. The individual cases are created with the CASEOF command. When an individual CASEOF expression matches the SWITCH expression, the macro executes whatever commands follow the CASEOF that provided the match.

Both the SWITCH and the CASEOF expressions are case sensitive (capitalization) and must match exactly. If none of the CASEOF expressions match the SWITCH expression, the macro executes the commands between DEFAULT and ENDSWITCH. If a DEFAULT command is not included, the macro is redirected to the commands following ENDSWITCH.

For example,

LABEL(Question)

CHAR(YESNO;"Do you have a preference? Y/N")

SWITCH(NTOC(YESNO))
CASEOF "Y";"y":  Type("Yes")
CASEOF "N";"n":  Type("No")
DEFAULT:                GO(Question)
ENDSWITCH

In this example, the CHAR command asks the user a question. The user's response is stored in the variable YESNO. The switch statement that follows then evaluates that variable and executes appropriate commands depending on the contents of the variable. Specifically, if the variable contains either an uppercase or a lowercase "y," the macro types the word "Yes." If the variable YESNO contains either an uppercase or lowercase "n," the macro will type the word "No." If the variable contains anything else, the macro returns to label Question and the user will have a chance to respond again.

The CHAR command only recognizes numbers. If a character is pressed in response to the CHAR command prompt, the character is converted to its numeric equivalent. The NTOC command in the switch expression converts the number back to its original character. For a list of characters and their numeric equivalents see Appendix A: Keystroke Numeric Equivalents.

Syntax

SWITCH(Expression)

Parameters

Expression
Specifies the expression to evaluate. All expressions are valid for this parameter.

Example

This macro constantly prompts for a name until Cancel is pressed or until Enter is pressed while the text box is empty.

ONCANCEL CALL(Cancel)

LABEL(Top)
        Name:=""
        GETSTRING(Name;"Type in a name, (Cancel or Enter) to quit";"Name")
IF(Name="")
        ASSERT(CancelCondition!)
ENDIF
        Type(Name)
        HardReturn
        GO(Top)

LABEL(Cancel)
        CANCEL(Off!)
        CHAR(Selection;"Do you really want to Quit? Y/N")
SWITCH(TOLOWER(NTOC(Selection)))
        CASEOF "y" : QUIT
        CASEOF "n" : CANCEL(On!) RETURN
        DEFAULT    : GO(Cancel)
ENDSWITCH

See Also

TOLOWER

TOLOWER converts a character expression to lowercase letters. This command is used in conjunction with commands that can evaluate its contents or perform an action such as ASSIGN, IF, and Type.

Syntax

TOLOWER(String)

Parameters

String
A character expression specifying the text to convert.

Example

This macro executes a Function from within a Type command.

Prmt:="Would you like to continue?"
Type ("You pressed "+YesNo(prmt))

                        //More code for the macro could be inserted here
Quit

FUNCTION YesNo (message)
LOCAL(ans)
LABEL(Begin)
CHAR(ans;message+"  Y/N")
        SWITCH(TOLOWER(NTOC(ans)))
CASEOF "y" : ans:="Y"
CASEOF "n" : ans:="N"
DEFAULT    : GO(Begin)
        ENDSWITCH
RETURN(ans)
ENDFUNC

See Also

TOUPPER

TOUPPER converts a character expression to uppercase letters. This command is used in conjunction with commands that can evaluate its contents or perform an action such as ASSIGN, IF, and Type.

Syntax

TOUPPER(String)

Parameters

String
A character expression specifying the text to convert.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

UNITSTR

UNITSTR converts a measurement expression to a character expression.

Syntax

UNITSTR(Measurement;Unit of Measurement)

Parameters

Measurement
A measurement expression specifying the number to convert.
Unit of Measurement
Specifies the unit of measurement. Select an enumerated type or its numeric equivalent
Enumerated Type Numeric Equivalent Description
Inches! 0 Converts inches (")
InchesI! 1 Converts inches (i)
Centimeters! 2 Converts centimeters
Millimeters! 3 Converts millimeters
Points! 4 Converts points
WP1200ths! 5 Converts 1200ths of an inch
WP42Units! 6 Converts WordPerfect Corporation's WordPerfect 4.2 units

Example

This macro takes the string 15 and displays it as a Number, Unit, and Unit String value.

Num:="15"
ASSIGN(Number;STRNUM(Num))
ASSIGN(Unit;STRUNIT(Num))
ASSIGN(UnitString;UNITSTR(Unit;Centimeters!))

Type("The Number value is "+ Number)
        HardReturn
Type("The Unit value is "+ Unit)
        HardReturn
Type("The Unit String value is "+ UnitString)
        HardReturn

UNTIL

UNTIL is the closing command of a REPEAT-UNTIL loop. The loop continues until the expression in the UNTIL command is true. For example, a macro that counts to ten could use the following REPEAT-UNTIL loop:

ASSIGN(Count;1)

REPEAT
ASSIGN(Count;Count + 1)
UNTIL(Count=10)

This example adds 1 to the value of variable Count each time the loop repeats. When Count equals 10, the UNTIL expression is satisfied and the loop ends. The macro then resumes with the command immediately following UNTIL. UNTIL expressions are evaluated at the end of the loop. As a result, a REPEAT-UNTIL loop always executes at least once, regardless of whether the condition is true or false. For information on conditional loops that evaluate expressions at the beginning and will not execute if the expression is false, see WHILE and ENDWHILE.

Syntax

UNTIL(Test)

Parameters

Test
A relational expression to evaluate.

Example

This macro counts keystrokes until the user presses Ctrl+Enter.

STATUSPROMPT("Press Ctrl+Enter to quit")
cnt:=0

REPEAT
        LOOK(info)
IF((info<>0) AND (info<>-8097))
        cnt:=cnt+1
        Type(NTOC(info))
ENDIF
UNTIL(info=-8097)

STATUSPROMPT("")
PAUSESET(EndFieldKey)
PROMPT("You pressed "+cnt+" keystrokes.  Press F9 to continue")
PAUSE

See Also

USE

USE enables macros to share FUNCTIONs and PROCEDUREs. This command specifies a macro containing FUNCTIONs and/or PROCEDUREs that can be used in the current macro. USE can specify a macro file library (a macro that does not execute, but simply contains FUNCTIONs and/or PROCEDUREs), or another executable macro.

Syntax

USE(Macro)

Parameters

Macro
A character expression specifying the macro or macro file library to use.

Example

This macro uses the function FileExists from the macro Library.wpm. FileExists could be designed to return a value representing whether the specified file exists.

DISPLAY(Off!)

USE("Library.wpm")

LABEL(Begin)
GetString(flname;"Enter the name of the file")
rslt:=FileExists("";flname+".doc")
        //FileExists is a function in Library.wpm  It returns a
        //boolean (True/false) value.
IF(rslt)
        CHAR(ans;"This file already exists.  Overwrite it? y/n")
SWITCH(NTOC(ans))
        CASEOF "Y";"y" : GO(Save)
        CASEOF "N";"n" : CONTINUE
        DEFAULT : GO(Begin)
ENDSWITCH
ENDIF

LABEL(Save)
FileSave(flname+".doc")

See Also

USERFUNCTION

USERFUNCTION passes executable strings from a macro to a third-party program. The string specified in this command depends on, and should be recognized by, the program to which it is passed. Since many third-party programs may have executable strings with the same name, it is wise, although not required, to preface the string with a "signature." This signature is a four to eight character string you create that identifies the program you want to involve. For example, many programs probably recognize the executable string of "Close," so a macro containing USERFUNCTION("Close") might interfere with the execution of a number of programs. To ensure that the string is only recognized and executed by a program with a name of MasterModem, for example, you could send the command USERFUNCTION("MM:Close"). Note that the signature becomes part of the string, but is separated from the command portion by a colon (:).

Syntax

USERFUNCTION(Action)

Parameters

Action
Specifies a character string that the third-party program can execute.

Example

This command is specific to third-party products such as TSRs. Therefore, no example is supplied since this command will be specific to the program to which it is passed.

VARERRCHK

VARERRCHK determines whether undefined variables cause an error message. By default, undefined variables generate the error "Variable not Assigned a Value" and the macro stops executing. Undefined variables can occur in commands, such as Type, that use variables to perform an action. For example, the command Type(Number) could generate an error if variable Number is not assigned earlier in the macro. The same error is generated if the Type command is meant to type the word "Number", but the quotes defining it as a character expression are not included. With VARERRCHK(Off!), a macro will continue running even if it contains undefined variables.

Syntax

VARERRCHK(State)

Parameters

State
Specifies whether variable error checking is on. Select an enumerated type or its numeric equivalent.
Enumerated Type Numeric Equivalent Description
Off! 0 Error checking off
On! 1 Error checking on

Example

This macro assigns a name to the variable Name if the variable doesn't exist.

VARERRCHK(Off!)

IF (Name="")
        GETSTRING(Name;"Enter your name";"Name")
        Type(Name)
ELSE
        Type(Name)
ENDIF

WAIT

WAIT suspends macro execution for a specified amount of time. This is useful, for example, to display a prompt on the screen for a certain amount of time. If a user begins typing while the macro is suspended, the keystrokes are ignored until the specified time has elapsed. The length of WAIT is specified in tenths of a second, with a maximum of one minute, or WAIT(600).

Syntax

WAIT(Tenths of a Second)

Parameters

Tenths of a Second
A numeric expression specifying the amount of time to wait.

Example

This macro prompts the user for a return address and assigns it to a series of variables. It then makes the variables accessible until Corel WordPerfect is exited.

DLGCREATE(x;"Return Address";DLGNoCancel!;;;50;10)
DLGCONTROL(CtrlText!;name;"Name";StyInitial!;1;3;37;2)
DLGCONTROL(CtrlText!;address;"Street Address";;1;5;27;2)
DLGCONTROL(CtrlText!;c;"City, State ZIP ";;1;7;25;2)
DLGEND
PERSISTALL
Prompt("All the variables are now accessible in any macro/merge.")
WAIT(50)

See Also

WHILE

WHILE is the opening command of a WHILE-ENDWHILE loop. This loop repeatedly executes the commands between WHILE and ENDWHILE as long as the WHILE expression is true. The expression is evaluated at the top of the loop. If the expression is false, macro execution resumes with the command immediately following ENDWHILE. For information on loops that evaluate expressions at the end of the loop, see REPEAT and UNTIL.

Syntax

WHILE(Test)

Parameters

Test
A relational expression to evaluate.

Example

This macro creates a data merge file through a series of prompts.

ASSIGN(More;"Y")
        WHILE(TOUPPER(More)="Y")
FOREACH(field;{"First Name";"Last
        Name";"Company";"Address";"City";"State";"Zip"})
        GETSTRING(info;"Enter the "+field;"Field "+field;)
        Type(info)
        EndField
        info:=""
ENDFOR
        MergeCode(EndRecord!)
        CHAR(More;"Enter another record? Y/N")
        ASSIGN(More;NTOC(More))
        ENDWHILE

See Also

XOR

XOR is an operator that evaluates at least two expressions in a conditional statement. Conditional statements are created with commands such as IF, REPEAT, and WHILE. This operator performs a logical exclusive OR and evaluates a conditional statement as true if one expression is true, but not if more than one expression is true.

Example

This macro sends an appropriate letter to one or both employees. For this macro to execute properly, the letters named "Congrats" and "ChewOut" must have already been created.

CHAR(Emp1;"Did employee number one finish the assigned task?  Y/N")
CHAR(Emp2;"Did employee number two finish the assigned task?  Y/N")

        IF((TOUPPER(Emp1)="Y") XOR (TOUPPER(Emp2)="Y"))
PERSIST(emp)
        SWITCH ("Y")
                CASEOF TOUPPER(Emp1) : CALL(Emp1)
                CASEOF TOUPPER(Emp2) : CALL(Emp2)
        ENDSWITCH
        ELSE
        IF(TOUPPER(Emp1)="Y")
        emp:="Both"
        Letter:="Congrats"
        ELSE
        emp:="Neither"
        Letter:="ChewOut"
        ENDIF
        ENDIF

CHAIN(Letter)
QUIT

LABEL(Emp1)
        emp:="Paul"
        Letter:="ChewOut"
RETURN

LABEL(Emp2)
        emp:="George"
        Letter:="ChewOut"
RETURN

See Also

System Variables Reference

?BlockActive

This variable contains a value representing whether Block is on.

Value Description
0 Block is not on
1 Block is on

?BlockedText

This variable contains blocked text and must be used between BlockOn and BlockOff commands.

For Example

BlockOn(CharMode!)
PosWordNext
IF (?BlockedText="Attention: ")
BEEP
ENDIF
BlockOff

?BorderBottomLine

This variable contains a value representing the bottom line style of a border. The value of this variable will be one of the enumerated types or numeric equivalents listed for the BorderBottomLine product command, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderBottomLine)
TextBorderEnd(Save!)

?BorderColorBlue

This variable contains a value representing whether the border color is blue. Values range from 0-255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderColorBlue)
TextBorderEnd(Save!)

?BorderColorGreen

This variable contains a value representing whether the border color is green. Values range from 0-255, with 0 indicating no green and 255 indicating solid green. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderColorGreen)
TextBorderEnd(Save!)

?BorderColorRed

This variable contains a value representing whether the border color is red. Values range from 0-255, with 0 indicating no red and 255 indicating solid red. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderColorRed)
TextBorderEnd(Save!)

?BorderColorShading

This variable contains a numeric expression representing the shading percentage of a border color. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderColorShading)
TextBorderEnd(Save!)

?BorderCornerRadius

This variable contains a measurement expression representing the corner radius of a border. The smallest value is 0" and indicates square corners. A higher value indicates more rounded corners. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderCornerRadius)
TextBorderEnd(Save!)

?BorderDropShadowBlue

This variable contains a value representing whether the border drop shadow is blue. Values range from 0-255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowBlue)
TextBorderEnd(Save!)

?BorderDropShadowDirection

This variable contains a value representing the location of the border drop shadow. The value for this variable will either be one of the enumerated types or numeric equivalents for the Location parameter of the BorderDropShadow product command. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowDirection)
TextBorderEnd(Save!)

?BorderDropShadowGreen

This variable contains a value representing whether the border drop shadow is green. Values range from 0-255, with 0 indicating no green and 255 indicating solid green. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowGreen)
TextBorderEnd(Save!)

?BorderDropShadowRed

This variable contains a value representing whether the border drop shadow is red. Values range from 0-255, with 0 indicating no red and 255 indicating solid red. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowRed)
TextBorderEnd(Save!)

?BorderDropShadowShading

This variable contains a numeric expression representing the shading value of the border drop shadow. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowShading)
TextBorderEnd(Save!)

?BorderDropShadowSpacing

This variable contains a measurement expression representing the size of the border shadow. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderDropShadowSpacing)
TextBorderEnd(Save!)

?BorderInsideSpacingBottom

This variable contains a measurement expression representing the bottom spacing inside a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderInsideSpacingBottom)
TextBorderEnd(Save!)

?BorderInsideSpacingLeft

This variable contains a measurement expression representing the left spacing inside a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderInsideSpacingLeft)
TextBorderEnd(Save!)

?BorderInsideSpacingRight

This variable contains a measurement expression representing the right spacing inside a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderInsideSpacingRight)
TextBorderEnd(Save!)

?BorderInsideSpacingTop

This variable contains a measurement expression representing the top spacing inside a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderInsideSpacingTop)
TextBorderEnd(Save!)

?BorderLeftLine

This variable contains a value representing the left line style of a border. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderLeftLine product command, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderLeftLine)
TextBorderEnd(Save!)

?BorderOutsideSpacingBottom

This variable contains a measurement expression representing the bottom outside spacing of a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderOutsideSpacingBottom)
TextBorderEnd(Save!)

?BorderOutsideSpacingLeft

This variable contains a measurement expression representing the left outside spacing of a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderOutsideSpacingLeft)
TextBorderEnd(Save!)

?BorderOutsideSpacingRight

This variable contains a measurement expression representing the right outside spacing of a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderOutsideSpacingRight)
TextBorderEnd(Save!)

?BorderOutsideSpacingTop

This variable contains a measurement expression representing the top outside spacing of a border. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderOutsideSpacingTop)
TextBorderEnd(Save!)

?BorderRightLine

This variable contains a value representing the right line style of a border. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderRightLine product command, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderRightLine)
TextBorderEnd(Save!)

?BorderSeparatorLine

This variable contains a value representing the separator line style of a border. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderSeparatorLine product command, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderSeparatorLine)
TextBorderEnd(Save!)

?BorderStyle

This variable contains a value representing a border style. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderStyleCreate or BorderStyleEdit product commands, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderStyle)
TextBorderEnd(Save!)

?BorderTopLine

This variable contains a value representing the top line style of a border. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderTopLine product command, or the name of a custom-made line style. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderTopLine)
TextBorderEnd(Save!)

?BorderUseBorderColor

This variable contains a value representing whether the border color option is used for a border. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the BorderUseBorderColor product command. This variable must be used between commands such as TextBorderCreate or TextBorderEdit and TextBorderEnd.

For Example

TextBorderEdit(1)
Type(?BorderUseBorderColor)
TextBorderEnd(Save!)

?BoxAttachTo

This variable contains a value representing whether a graphics box is attached to a page, a paragraph, or a character. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxAttachTo command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxAttachTo=2)
BEEP
ENDIF
BoxEnd(Save!)

?BoxAutoPosition

This variable contains a value representing whether to position the current graphics box at the cursor. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Do no position at cursor
1 Position at cursor

For Example

BoxEdit(1)
IF(?BoxAutoPosition=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxCaptionFormatting

This variable contains a value representing the width of a graphics box caption. If the width is set to Auto, the value of this variable is 2. Otherwise, the value is either a measurement expression in the current unit of measure or a percentage of the box width or height. This command must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxCaptionFormatting)
BoxEnd(Save!)

?BoxCaptionInitialStyle

This variable contains a value representing the initial style of a graphics box caption. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxCaptionInitialStyle command, or the name of a user-created style. This variable must be used between either BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxStyleEdit(FigureBox!)
Type(?BoxCaptionInitialStyle)
BoxStyleEnd(Save!)

?BoxCaptionNumberStyle

This variable contains a value representing the number style of a graphics box caption. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxCaptionNumberStyle command. This variable must be used between either BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxStyleEdit(FigureBox!)
IF(?BoxCaptionNumberStyle=0)
BEEP
ENDIF
BoxStyleEnd(Save!)

?BoxCaptionPositionAlignment

This variable contains a value representing the alignment of a graphics box caption. The value of this variable is one of the enumerated types or numeric equivalents listed for the Position parameter of the BoxCaptionPosition command. This variable must be used between either BoxCreate or BoxEdit or BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxCaptionPositionAlignment=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxCaptionPositionBorder

This variable contains a value representing the position of a graphics box caption relative to the border. The value of this variable is one of the enumerated types or numeric equivalents listed for the Relation to Border parameter of the BoxCaptionPosition command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxCaptionPositionBorder=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxCaptionPositionOffset

This variable contains a value representing the offset position of a graphics box caption. The value of this variable is either a measurement expression in the current unit of measure or a percentage of the box width or height. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxCaptionPositionOffset)
BoxEnd(Save!)

?BoxCaptionPositionSide

This variable contains a value representing the side of a graphics box where a caption is located. The value of this variable is one of the enumerated types or numeric equivalents listed for the Side of Box parameter of the BoxCaptionPosition command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxCaptionPositionSide=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxCaptionRotation

This variable contains a value representing the rotation degree of a graphics box caption. The value of this variable is one of the enumerated types or numeric equivalents listed for the Box Caption Rotation parameter of the BoxCaptionPosition command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxCaptionRotation=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxChangeLineHeight

This variable contains a value representing whether a graphics box attached to a character position automatically changes the text line height. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 No change
1 Change

?BoxContentFilename

This variable contains the name of a text file or image file contained in a graphics box. The value of this variable is a filename. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxContentFilename)
BoxEnd(Save!)

?BoxContentHorizontalPosition

This variable contains a value representing the horizontal position of a graphics box contents. The value of this variable is one of the enumerated types or numeric equivalents listed for the Horizontal parameter of the BoxContentPosition command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxContentHorizontalPosition=0)
BEEP
ENDIF
BoxEnd(Save!)

?BoxContentInternal

This variable contains a value representing whether an image is stored in the current document or on a disk.

Value Description
0 In document
1 On disk

?BoxContentPreserveAspectRatio

This variable contains a value representing whether the image width/height ratio is preserved when the position of a box changes. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Not preserved
1 Preserved

?BoxContentType

This variable contains a value representing the type of content in a graphics box. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxContentType command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxContentType=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxContentVerticalPosition

This variable contains a value representing the vertical position of a graphics box contents. The value of this variable is one of the enumerated types or numeric equivalents listed for the Vertical parameter of the BoxContentPosition command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxContentVerticalPosition=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxCounter

This variable contains a value representing the counter type of a graphics box or graphics box style. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxCounter command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
IF(?BoxCounter=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxEquationColorBlue

This variable contains a value representing whether an equation color contains blue. Values range from 0 to 255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationColorBlue)
BoxEnd(Save!)

?BoxEquationColorGreen

This variable contains a value representing whether an equation color contains green. Values range from 0 to 255, with 0 indicating no green and 255 indicating solid green. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationColorGreen)
BoxEnd(Save!)

?BoxEquationColorRed

This variable contains a value representing whether an equation color contains red. Values range from 0 to 255, with 0 indicating no red and 255 indicating solid red. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationColorRed)
BoxEnd(Save!)

?BoxEquationColorShading

This variable contains a value representing the shade of an equation color. The value of this variable is a percentage, with 100 indicating the darkest shade of a color. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationColorShading)
BoxEnd(Save!)

?BoxEquationFont

This variable contains a specified font for an equation box. The value of this variable is the name of a font. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationFont)
BoxEnd(Save!)

?BoxEquationFontSize

This variable contains a value representing an equation box font size. The value of this variable is a measurement expression in the current unit of measure. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxEquationFontSize)
BoxEnd(Save!)

?BoxHeight

This variable contains a value representing the height of a graphics box. If the height is set to Auto, the value of this variable is 2. Otherwise, the value is a measurement expression in the current unit of measure. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxHeight)
BoxEnd(Save!)

?BoxHorizontalAlignment

This variable contains a value representing the horizontal position of a graphics box attached to a page or a paragraph. The value of this variable is one of the enumerated types or numeric equivalents listed for the Position parameter of the BoxHorizontalAlignment command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxHorizontalAlignment=7)
BEEP
ENDIF
BoxEnd(Save!)

?BoxHorizontalAlignTo

This variable contains a value representing whether a graphics box attached to a page is aligned to the margins or to a column or columns. The value of this variable is one of the enumerated types or numeric equivalents listed for the Alignment parameter of the BoxHorizontalAlignment command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxHorizontalAlignTo=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxHorizontalOffset

This variable contains a value representing the right or left position of a graphics box relative to an alignment point. The value of this variable is a measurement expression in the current unit of measure. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxHorizontalOffset)
BoxEnd(Save!)

?BoxImageBlackWhiteThreshold

This variable contains a value representing a threshold where colors and/or grays convert to black or white. Colors or grays below the threshold are converted to black; those above are converted to white. Values range from 1 to 255, with 127 as the default. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageBlackWhiteThreshold)
BoxEnd(Save!)

?BoxImageBrightness

This variable contains a value representing the brightness of an image color. Values range from -1.0 (all black) to 1.0 (all white). This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageBrightness)
BoxEnd(Save!)

?BoxImageContrast

This variable contains a value representing image contrast. Values range from -1.0 (slight contrast) to 1.0 (substantial contrast). This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageContrast)
BoxEnd(Save!)

?BoxImageDitherMethod

This variable contains a value representing a dither method. The value of this variable is one of the enumerated types or numeric equivalents listed for the Method parameter of the BoxImageDitherMethod command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxImageDitherMethod=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxImageDitherSource

This variable contains a value representing a dither source. The value of this variable is one of the enumerated types or numeric equivalents listed for the Source parameter of the BoxImageDitherMethod command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxImageDitherSource=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxImageFill

This variable contains a value representing an image fill type. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxImageFill command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands

For Example

BoxEdit(1)
IF(?BoxImageFill=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxImageFlipX

This variable contains a value representing whether the horizontal axis of an image is reversed. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands

Value Description
0 Not reversed
1 Reversed

?BoxImageFlipY

This variable contains a value representing whether the vertical axis of an image is reversed. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Not reversed
1 Reversed

?BoxImageHalftoneAngle0

This variable contains the image halftone angle. The default is generally 45, but is dependent upon the selected printer.

?BoxImageHalftoneAngle1

This variable contains the image halftone angle 1.

?BoxImageHalftoneAngle2

This variable contains the image halftone angle 2.

?BoxImageHalftoneAngle3

This variable contains the image halftone angle 3.

?BoxImageHalftoneScreenLPI

This variable contains the current halftone LPI, where 60 is the original default setting.

Values Description
1 White
Values greater than 1, up to the maximum supported by your printer Adds black

?BoxImageInvertColors

This variable contains a value representing whether image colors have been inverted to their respective complementary colors. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Not inverted
1 Inverted

?BoxImageMonochrome

This variable contains a value representing whether a color image converts to black and white. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Not monochrome
1 Monochrome

?BoxImageRotation

This variable contains a value representing a rotation degree. Values range from 0.0 to 359.0. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageRotation)
BoxEnd(Save!)

?BoxImageScalingX

This variable contains a value representing a scaling width. The value of this variable ranges from 0.01 to 9.99. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxImageScalingX=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxImageScalingY

This variable contains a value representing a scaling height. The value of this variable ranges from 0.01 to 9.99. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxImageScaling=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxImageTranslationX

This variable contains a value representing the horizontal position of an image within a box. Values range from -5.0 to 5.0, with the default at 0.0. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageTranslationX)
BoxEnd(Save!)

?BoxImageTranslationY

This variable contains a value representing the vertical position of an image within a box. Values range from -5.0 to 5.0, with the default at 0.0. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxImageTranslationY)
BoxEnd(Save!)

?BoxInsertFullPageOn

This variable contains a value representing whether a full page graphic is placed on the current or next page. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Following page
1 Current page

For Example

BoxEdit(1)
IF(?BoxInsertFullPageOn=0)
BEEP
ENDIF
BoxEnd(Save!)

?BoxLeftColumn

This variable contains a value representing the left column to which a graphics box aligns. The value of this variable is the number of a column. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxLeftColumn?)
BoxEnd(Save!)

?BoxNumber

This variable contains the current graphics box number. The value of this variable is the number of the box following the cursor.

?BoxOverlap

This variable contains a value representing whether a graphics box may overlap other boxes. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 No overlap
1 Overlap

?BoxPageOffset

This variable contains a value representing whether a box stays on the page to which it was attached or moves with text. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Does not stay on page
1 Stays on page

?BoxRightColumn

This variable contains a value representing the right column to which a graphics box aligns. The value of this variable is the number of a column. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxRightColumn)
BoxEnd(Save!)

?BoxStyleName

This variable contains the name of a box style. The value of this variable is either one of the enumerated types or numeric equivalents listed for the BoxStyleEdit command, or the name of a user-created style. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands, or between BoxStyleCreate or BoxStyleEdit and BoxStyleEnd commands.

For Example

BoxEdit(1)
Type(?BoxStyleName)
BoxEnd(Save!)

?BoxTextAngle

This variable contains a value representing the degree of rotation for text in a box. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxTextAngle command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxTextAngle=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxTextDefaultStyle

This variable contains the default style of box text. The value of this variable is one of the enumerated types or numeric equivalents listed for the BoxTextDefaultStyle command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxTextDefaultStyle=127)
BEEP
ENDIF
BoxEnd(Save!)

?BoxVerticalAlignment

This variable contains a value representing the vertical position of a graphics box attached to a page or character. The value of this variable is one of the enumerated types or numeric equivalents listed for the Position parameter of the BoxVerticalAlignment command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxVerticalAlignment=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxVerticalAlignTo

This variable contains a value representing whether a box is aligned to margins.

Value Description
1 Aligned to margins
2 Fixed position

?BoxVerticalOffset

This variable contains a value representing the vertical position of a graphics box relative to an alignment point. The value of this variable is a measurement expression in the current unit of measure. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxVerticalOffset)
BoxEnd(Save!)

?BoxWidth

This variable contains a value representing the width of a graphics box. If the width is set to Auto, the value of this variable is one of the enumerated types or numeric equivalents listed for the BoxWidth command. Otherwise, the value is a measurement expression in the current unit of measure. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?BoxWidth)
BoxEnd(Save!)

?BoxWrapping

This variable contains a value representing the direction of text flow around a graphics box. The value of this variable is one of the enumerated types or numeric equivalents of the BoxTextFlow command. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
IF(?BoxWrapping=1)
BEEP
ENDIF
BoxEnd(Save!)

?BoxWrappingType

This variable contains a value representing whether the text outside a graphics box flows around an image. This variable must be used between either BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Text is not contoured
1 Text is contoured

?ButtonBar

This variable contains a value representing whether the button bar is displayed.

Value Description
0 Not displayed
1 Displayed

?CapBeginSentence

This variable contains a value representing whether to automatically capitalize the first letter of each sentence as it is typed.

Value Description
0 Do not capitalize
1 Capitalize

?Cell

This variable contains a value representing the current table cell. For example, if the cursor is in the first cell of a table, this variable contains the value A1.

?CellAlignment

This variable contains a value representing the vertical alignment of the current cell.

Value Description
0 Top
1 Bottom
2 Center

?CellBold

This variable contains a value representing whether the cell font attribute is Bold.

Value Description
0 Not Bold
1 Bold

?CellDoubleUnderline

This variable contains a value representing whether the cell font attribute is Double Underline.

Value Description
0 Not Double Underline
1 Double Underline

?CellExtraLarge

This variable contains a value representing whether the cell font attribute is Extra Large.

Value Description
0 Not Extra Large
1 Extra Large

?CellFine

This variable contains a value representing whether the cell font attribute is Fine.

Value Description
0 Not Fine
1 Fine

?CellFormula

This variable contains a value representing whether the cell contains a formula.

Value Description
0 Does not contain a formula
1 Contains a formula

?CellIgnoreWhenCalculating

This variable contains a value representing whether to ignore the current cell or blocked cells when calculating formulas.

Value Description
0 Do not ignore
1 Ignore

?CellItalics

This variable contains a value representing whether the cell font attribute is Italics.

Value Description
0 Not Italics
1 Italics

?CellJustification

This variable contains a value representing the justification of the current cell. The value of this variable is one of the enumerated types or numeric equivalents listed for the TableCellJustification command.

?CellLarge

This variable contains a value representing whether the cell font attribute is Large.

Value Description
0 Not Large
1 Large

?CellLocked

This variable contains a value representing whether the current cell is locked.

Value Description
0 Not locked
1 Locked

?CellNormal

This variable contains a value representing whether the cell font attribute is Normal (no specified attributes).

Value Description
0 Not normal
1 Normal

?CellOutline

This variable contains a value representing whether the cell font attribute is Outline.

Value Description
0 Not Outline
1 Outline

?CellRedline

This variable contains a value representing whether the cell font attribute is Redline.

Value Description
0 Not Redline
1 Redline

?CellShadow

This variable contains a value representing whether the cell font attribute is Shadow.

Value Description
0 Not Shadow
1 Shadow

?CellSmall

This variable contains a value representing whether the cell font attribute is Small.

Value Description
0 Not Small
1 Small

?CellSmallCaps

This variable contains a value representing whether the cell font attribute is Small Caps.

Value Description
0 Not Small Caps
1 Small Caps

?CellSpecificAttribute

This variable contains a value representing whether the current cell contains cell-specific attributes as opposed to the default column attributes.

Value Description
0 Contains default column attributes
1 Contains cell-specific attributes

?CellSpecificJustification

This variable contains a value representing whether cell justification is active in the current cell.

Value Description
0 No cell justification
1 Cell justification

?CellStrikeout

This variable contains a value representing whether the cell font attribute is Strikeout.

Value Description
0 Not Strikeout
1 Strikeout

?CellSubscript

This variable contains a value representing whether the cell font attribute is Subscript.

Value Description
0 Not Subscript
1 Subscript

?CellSuperscript

This variable contains a value representing whether the cell font attribute is Superscript.

Value Description
0 Not Superscript
1 Superscript

?CellUnderline

This variable contains a value representing whether the cell font attribute is Underline.

Value Description
0 Not Underline
1 Underline

?CellVeryLarge

This variable contains a value representing whether the cell font attribute is Very Large.

Value Description
0 Not Very Large
1 Very Large

?Column

This variable contains the number of the current text column or table column.

?DateDay

This variable contains a numeric value representing the current day of the month.

?DateMonth

This variable contains a numeric value representing the current month.

?DateWeekday

This variable contains a numeric value representing the current day of the week. On Sundays this variable contains the value 0, so values range from 0 to 6.

?DateYear

This variable contains a numeric value representing the current year.

?Dialog

This variable contains a value representing the number of the current dialog.

In the following examples, the first macro gets the number of the current dialog box, and the second macro prints it to the screen. When you create the macros, the first one must be named using the Alt key. To use the macros, open a dialog box, play the first macro, close the dialog, and then play the second macro.

For Example

Assign(One;?Dialog)
Persist(One)

For Example

Type(One)

?DialogControl

This variable contains a value representing the number of the dialog control at the cursor position in the dialog. To use this variable, see the example under ?Dialog and substitute ?DialogControl for ?Dialog.

?Direction

This variable contains a value representing the direction to enter text.

Value Description
0 Left to right
1 Right to left

?DocBlank

This variable contains a value representing whether the current document is blank, meaning no characters have been entered. If characters have been entered and erased, the document is not blank.

Value Description
0 Not blank
1 Blank

?DocModified

This variable contains a value representing whether the current document has been modified.

Value Description
0 Not modified
1 Modified

?DocNeedsGenerating

This variable contains a value representing whether the current document has been modified since it was last generated.

Value Description
0 Not modified
1 Modified

?DocNumber

This variable contains the current document number. Values range from 1 to 9.

?DocSummaryAbstract

This variable contains the text of the Abstract field in the current document summary.

?DocSummaryAccount

This variable contains the text of the Account field in the current document summary.

?DocSummaryAddress

This variable contains the text of the Address field in the current document summary.

?DocSummaryAttachments

This variable contains the text of the Attachments field in the current document summary.

?DocSummaryAuthor

This variable contains the text of the Author field in the current document summary.

?DocSummaryAuthorization

This variable contains the text of the Authorization field in the current document summary.

?DocSummaryBillTo

This variable contains the text of the Bill To field in the current document summary.

?DocSummaryBlindCopy

This variable contains the text of the Blind Copy field in the current document summary.

?DocSummaryCarbonCopy

This variable contains the text of the Carbon Copy field in the current document summary.

?DocSummaryCategory

This variable contains the text of the Category field in the current document summary.

?DocSummaryCheckedBy

This variable contains the text of the Checked By field in the current document summary.

?DocSummaryClient

This variable contains the text of the Client field in the current document summary.

?DocSummaryComments

This variable contains the text of the Comments field in the current document summary.

?DocSummaryCreationDate

This variable contains the text of the Creation Date field in the current document summary.

?DocSummaryDateCompleted

This variable contains the text of the Date Completed field in the current document summary.

?DocSummaryDepartment

This variable contains the text of the Department field in the current document summary.

?DocSummaryDescriptiveName

This variable contains the text of the Descriptive Name field in the current document summary.

?DocSummaryDescriptiveType

This variable contains the text of the Descriptive Type field in the current document summary.

?DocSummaryDestination

This variable contains the text of the Destination field in the current document summary.

?DocSummaryDisposition

This variable contains the text of the Disposition field in the current document summary.

?DocSummaryDivision

This variable contains the text of the Division field in the current document summary.

?DocSummaryDocNumber

This variable contains the text of the Document Number field in the current document summary.

?DocSummaryEditor

This variable contains the text of the Editor field in the current document summary.

?DocSummaryForwardTo

This variable contains the text of the Forward To field in the current document summary.

?DocSummaryGroup

This variable contains the text of the Group field in the current document summary.

?DocSummaryKeywords

This variable contains the text of the Keyword field in the current document summary.

?DocSummaryLanguage

This variable contains the text of the Language field in the current document summary.

?DocSummaryMailStop

This variable contains the text of the Mail Stop field in the current document summary.

?DocSummaryMatter

This variable contains the text of the Matter field in the current document summary.

?DocSummaryOffice

This variable contains the text of the Office field in the current document summary.

?DocSummaryOwner

This variable contains the text of the Owner field in the current document summary.

?DocSummaryProject

This variable contains the text of the Project field in the current document summary.

?DocSummaryPublisher

This variable contains the text of the Publisher field in the current document summary.

?DocSummaryPurpose

This variable contains the text of the Purpose field in the current document summary.

?DocSummaryReceivedFrom

This variable contains the text of the Received From field in the current document summary.

?DocSummaryRecordedBy

This variable contains the text of the Recorded By field in the current document summary.

?DocSummaryRecordedDate

This variable contains the text of the Recorded Date field in the current document summary.

?DocSummaryReference

This variable contains the text of the Reference field in the current document summary.

?DocSummaryRevisionDate

This variable contains the text of the Revision Date field in the current document summary.

?DocSummaryRevisionNotes

This variable contains the text of the Revision Notes field in the current document summary.

?DocSummaryRevisionNumber

This variable contains the text of the Revision Number field in the current document summary.

?DocSummarySection

This variable contains the text of the Section field in the current document summary.

?DocSummarySecurity

This variable contains the text of the Security field in the current document summary.

?DocSummarySource

This variable contains the text of the Source field in the current document summary.

?DocSummaryStatus

This variable contains the text of the Status field in the current document summary.

?DocSummarySubject

This variable contains the text of the Subject field in the current document summary.

?DocSummaryTelephoneNumber

This variable contains the text of the Telephone Number field in the current document summary.

?DocSummaryTypist

This variable contains the text of the Typist field in the current document summary.

?DocSummaryVersionDate

This variable contains the text of the Version Date field in the current document summary.

?DocSummaryVersionNotes

This variable contains the text of the Version Notes field in the current document summary.

?DocSummaryVersionNumber

This variable contains the text of the Version Number field in the current document summary.

?DoubleSmartQuote

This variable contains a value representing whether the Double Smart Quotes feature is on or off.

Value Description
0 Off
1 On

?DropCapBorderStyle

This variable contains a value representing a drop cap border style. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the DropCapBorderStyle product command, or the name of a user-defined style. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapBorderStyle)
DropCapEnd(Save!)

?DropCapCharacters

This variable contains a value representing how many characters are included in the current drop cap. 0 represents an entire word. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapCharacters)
DropCapEnd(Save!)

?DropCapCharacterSize

This variable contains a value representing, in text lines, the height of the current drop cap. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapCharacterSize)
DropCapEnd(Save!)

?DropCapFillStyle

This variable contains a value representing a drop cap fill style. The value of this variable will either be one of the enumerated types or numeric equivalents listed for the DropCapFillStyle product command, or the name of a user-defined style. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapFillStyle)
DropCapEnd(Save!)

?DropCapHorizontalAdjustment

This variable contains a value representing what percentage of the current drop cap is located in the margin. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapHorizontalAdjustment)
DropCapEnd(Save!)

?DropCapIncludeDescender

This variable contains a value representing whether space is allowed for descending characters in the current drop cap. This variable must be used between DropCapBegin and DropCapEnd.

Value Description
0 No space for descending characters
1 Space for descending characters

?DropCapIncludeDiacritic

This variable contains a value representing whether space is allowed for diacritical marks in the current drop cap. This variable must be used between DropCapBegin and DropCapEnd.

Value Description
0 No space for diacritical marks
1 Space for diacritical marks

?DropCapInParagraph

This variable contains a value representing whether the current paragraph contains a drop cap.

Value Description
0 Does not contain a drop cap
1 Contains a drop cap

?DropCapKerning

This variable contains a value representing the space adjustment between the current drop cap and paragraph text. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapKerning)
DropCapEnd(Save!)

?DropCapNoWrap

This variable contains a value representing whether the option to wrap text around the current drop cap is on or off. This variable must be used between DropCapBegin and DropCapEnd.

Value Description
0 Wrap text
1 Do not wrap text

?DropCapState

This variable contains a value representing whether a drop cap is currently being created or edited.

Value Description
0 Drop cap not being created or edited
1 Drop cap being created or edited

?DropCapUseColor

This variable contains a value representing whether the current drop cap color is based on subsequent paragraph text or is independent of paragraph text.

Value Description
0 Color based on paragraph text
1 Independent color

?DropCapVerticalAdjustment

This variable contains a value representing the number of blank lines between the current drop cap and subsequent paragraph text. This variable must be used between DropCapBegin and DropCapEnd.

For Example

DropCapBegin
Type(?DropCapVerticalAdjustment)
DropCapEnd(Save!)

?EditScreen

This variable contains a value representing whether the current screen is an editing screen.

Value Description
0 Not an editing screen
1 Editing screen

?EndOfSentenceSpacing

This variable contains a value representing which end of sentence spacing option is available.

Value Description
0 No change to spacing
1 Single to double
2 Double to single

?Endnote

This variable returns the endnote number to the left of the cursor.

?Entry

This variable contains a value representing the current dialog entry. The value of this variable is the text of the current entry or a numeric value indicating the state of the option.

Value Description
0 Off
1 On

?FillColor1Blue

This variable contains a value representing the amount of blue in the foreground color of a fill style. Values range from 0 to 255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor1Blue)
FillStyleEnd(Save!)

?FillColor1Green

This variable contains a value representing the amount of green in the foreground color of a fill style. Values range from 0 to 255, with 0 indicating no green and 255 indicating solid green. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor1Green)
FillStyleEnd(Save!)

?FillColor1Red

This variable contains a value representing the amount of red in the foreground color of a fill style. Values range from 0 to 255, with 0 indicating no red and 255 indicating solid red. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor1Red)
FillStyleEnd(Save!)

?FillColor1Shading

This variable contains a value representing the shade of the foreground color of a fill style. Values range from 0 to 100, with 100 indicating the darkest shade of the color. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor1Shading)
FillStyleEnd(Save!)

?FillColor2Blue

This variable contains a value representing the amount of blue in the background color of a fill style. Values range from 0 to 255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor2Blue)
FillStyleEnd(Save!)

?FillColor2Green

This variable contains a value representing the amount of green in the background color of a fill style. Values range from 0 to 255, with 0 indicating no green and 255 indicating solid green. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor2Green)
FillStyleEnd(Save!)

?FillColor2Red

This variable contains a value representing the amount of red in the background color of a fill style. Values range from 0 to 255, with 0 indicating no red and 255 indicating solid red. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor2Red)
FillStyleEnd(Save!)

?FillColor2Shading

This variable contains a value representing the shade of the background color of a fill style. Values range from 0 to 100, with 100 indicating the darkest shade of the color. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillColor2Shading)
FillStyleEnd(Save!)

?FillGradientAngle

This variable contains the rotation angle of a linear or rectangular gradient. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillGradientAngle)
FillStyleEdit(Save!)

?FillGradientMatchAspectRatio

This variable contains a value representing whether a fill gradient matches the document aspect ratio. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

Value Description
0 Does not match aspect ratio
1 Matches aspect ratio

?FillGradientSteps

This variable contains the number of shades in a gradient. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillGradientSteps)
FillStyleEdit(Save!)

?FillGradientType

This variable contains a value representing a type of gradient. The value of this variable is one of the enumerated types or numeric equivalents listed for the FillSetGradient command. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillGradientType)
FillStyleEdit(Save!)

?FillGradientXOffset

This variable contains a value representing the horizontal center of a radial or rectangular gradient, or the horizontal offset of a rotated linear gradient. The value of this variable is a percentage of the box or border width. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillGradientXOffset)
FillStyleEdit(Save!)

?FillGradientYOffset

This variable contains a value representing the vertical center of a radial or rectangular gradient, or the top of a linear gradient. The value of this variable is a percentage of the box or border height. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands.

For Example

FillStyleEdit("My Style")
Type(?FillGradientYOffset)
FillStyleEdit(Save!)

?FillStyle

This variable contains a value representing the current fill style. The value of this variable is one of the enumerated types or numeric equivalents listed for the FillStyleEdit command, or the name of a user-created fill style. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands, or between BoxCreate or BoxEdit and BoxEnd commands.

For Example

BoxEdit(1)
Type(?FillStyle)
BoxEnd(Save!)

?FillType

This variable contains a value representing whether the fill is a pattern or a gradient. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands, or between BoxCreate or BoxEdit and BoxEnd commands.

Value Description
0 Pattern
1 Gradient

?FillWPG2Pattern

This variable contains a value representing a predefined fill pattern. The value of this variable is one of the enumerated types or numeric equivalents listed for the Pattern parameter of the FillSetWPG2 command. This variable must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands, or between BoxCreate or BoxEdit and BoxEnd commands.

For Example

FillStyleEdit("Button Fill")
Type(?FillWPG2Pattern)
FillStyleEnd(Save!)

?FillWPG2Set

This variable contains a value representing a predefined fill pattern set. In the current version of Corel WordPerfect, only pattern set 0 is available, so the value of this variable is 0. This command must be used between either FillStyleCreate or FillStyleEdit and FillStyleEnd commands, or between BoxCreate or BoxEdit and BoxEnd commands.

For Example

FillStyleEdit("Button Fill")
IF(?FillWPG2Set=0)
BEEP
ENDIF
FillstyleEnd(Save!)

?FontBold

This variable contains a value representing whether the current font attribute is Bold.

Value Description
0 Not Bold
1 Bold

?FontDoubleUnderline

This variable contains a value representing whether the current font attribute is Double Underline.

Value Description
0 Not Double Underline
1 Double Underline

?FontExtraLarge

This variable contains a value representing whether the current font attribute is Extra Large.

Value Description
0 Not Extra Large
1 Extra Large

?FontFine

This variable contains a value representing whether the current font attribute is Fine.

Value Description
0 Not Fine
1 Fine

?FontItalics

This variable contains a value representing whether the current font attribute is Italics.

Value Description
0 Not Italics
1 Italics

?FontLarge

This variable contains a value representing whether the current font attribute is Large.

Value Description
0 Not Large
1 Large

?FontNormal

This variable contains a value representing whether the current font attribute is Normal (no specified attributes).

Value Description
0 Not Normal
1 Normal

?FontOutline

This variable contains a value representing whether the current font attribute is Outline.

Value Description
0 Not Outline
1 Outline

?FontRedline

This variable contains a value representing whether the current font attribute is Redline.

Value Description
0 Not Redline
1 Redline

?FontShadow

This variable contains a value representing whether the current font attribute is Shadow.

Value Description
0 Not Shadow
1 Shadow

?FontSmall

This variable contains a value representing whether the current font attribute is Small.

Value Description
0 Not Small
1 Small

?FontSmallCaps

This variable contains a value representing whether the current font attribute is Small Caps.

Value Description
0 Not Small Caps
1 Small Caps

?FontStrikeout

This variable contains a value representing whether the current font attribute is Strikeout.

Value Description
0 Not Strikeout
1 Strikeout

?FontSubscript

This variable contains a value representing whether the current font attribute is Subscript.

Value Description
0 Not Subscript
1 Subscript

?FontSuperscript

This variable contains a value representing whether the current font attribute is Superscript.

Value Description
0 Not Superscript
1 Superscript

?FontUnderline

This variable contains a value representing whether the current font attribute is Underline.

Value Description
0 Not Underline
1 Underline

?FontVeryLarge

This variable contains a value representing whether the current font attribute is Very Large.

Value Description
0 Not Very Large
1 Very Large

?Footnote

This variable contains the footnote number to the left of the cursor.

?Framed

This variable contains a value representing whether the active window is framed.

Value Description
0 Not framed
1 Framed

?GraphicsLineBottomSpacing

This variable contains a value representing the amount of space below a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineBottomSpacing)
GraphicsLineEnd(Save!)

?GraphicsLineColorBlue

This variable contains a value representing the amount of blue in a graphics line color. Values range from 0 to 255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineColorBlue)
GraphicsLineEnd(Save!)

?GraphicsLineColorGreen

This variable contains a value representing the amount of green in a graphics line color. Values range from 0 to 255, with 0 indicating no green and 255 indicating solid green. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineColorGreen)
GraphicsLineEnd(Save!)

?GraphicsLineColorName

This variable contains the name of a graphics line color. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineColorName)
GraphicsLineEnd(Save!)

?GraphicsLineColorRed

This variable contains a value representing the amount of red in a graphics line color. Values range from 0 to 255, with 0 indicating no red and 255 indicating solid red. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineColorRed)
GraphicsLineEnd(Save!)

?GraphicsLineColorShading

This variable contains a value representing the shade of a graphics line color. Values range from 0 to 100, with 100 indicating the darkest shade of a color. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineColorShading)
GraphicsLineEnd(Save!)

?GraphicsLineHorizontalAlign

This variable contains a value representing the horizontal alignment of a graphics line. The value of this variable is one of the enumerated types or numeric equivalents listed for the Location parameter of the GraphicsLineHorizontalPosition command. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineHorizontalAlign)
GraphicsLineEnd(Save!)

?GraphicsLineHorizontalColumn

This variable contains a column number. When the horizontal position of a graphics line is set to Between Columns, the value of this variable is the number of the column to the left of the line. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineHorizontalColumn)
GraphicsLineEnd(Save!)

?GraphicsLineHorizontalPos

This variable contains a value representing the horizontal position of a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineHorizontalPos)
GraphicsLineEnd(Save!)

?GraphicsLineLength

This variable contains the length of a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineLength)
GraphicsLineEnd(Save!)

?GraphicsLineStyle

This variable contains a value representing a graphics line style. The value of this variable is either one of the enumerated types or numeric equivalents listed for the GraphicsLineStyle command, or the name of a user-created style. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLinestyle)
GraphicsLineEnd(Save!)

?GraphicsLineThickness

This variable contains a value representing the thickness of a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineThickness)
GraphicsLineEnd(Save!)

?GraphicsLineTopSpacing

This variable contains a value representing the amount of space above a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineTopSpacing)
GraphicsLineEnd(Save!)

?GraphicsLineType

This variable contains a value representing whether a graphics line is horizontal or vertical. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

Value Description
0 Horizontal line
1 Vertical line

?GraphicsLineUseColor

This variable contains a value representing whether to use the current line style color or to choose another color. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

Value Description
0 Use line style color
1 Choose a color

?GraphicsLineVerticalAlign

This variable contains a value representing the vertical alignment of a graphics line. The value of this variable is one of the enumerated types or numeric equivalents listed for the Location parameter of the GraphicsLineVerticalPosition command. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineVerticalAlign)
GraphicsLineEnd(Save!)

?GraphicsLineVerticalPosition

This variable contains a value representing the vertical position of a graphics line. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either GraphicsLineCreate or GraphicsLineEdit and GraphicsLineEnd commands.

For Example

GraphicsLineEdit(1)
Type(?GraphicsLineVerticalPosition)
GraphicsLineEnd(Save!)

?HorizontalScrollBar

This variable contains a value representing whether the horizontal scroll bar is displayed.

Value Description
0 Not displayed
1 Displayed

?HypertextActive

This variable contains a value representing whether hypertext is active.

Value Description
0 Not active
1 Active

?InColumn

This variable contains a value representing whether the cursor is in columns.

Value Description
0 Cursor is not in columns
1 Cursor is in columns

?Initials

This variable contains the initials of the current user. This variable exists only if a network version of Corel WordPerfect is running.

?InMath

This variable contains a value representing whether the cursor is in math.

Value Description
0 Cursor is not in math
1 Cursor is in math

?InTable

This variable contains a value representing whether the cursor is in a table.

Value Description
0 Cursor is not in a table
1 Cursor is in a table

?InterimRelease

This variable contains the interim release number of the current version of Corel WordPerfect. For example, the value assigned to the initial release is 0, the value assigned to the first interim release is 1, etc.

?IrregularCap

This variable contains a value representing whether the feature that lowercases the second of two consecutive initial capitals is on or off.

Value Description
0 Off
1 On

?Justification

This variable contains a value representing the current justification. The value of this variable is one of the enumerated types or numeric equivalents listed for the Justification command.

?KeyAlt

This variable contains a value representing whether the Alt key is pressed.

Value Description
0 Not pressed
1 Pressed

?KeyCapsLock

This variable contains a value representing whether Caps Lock is on.

Value Description
0 Off
1 On

?KeyCtrl

This variable contains a value representing whether the Ctrl key is pressed.

Value Description
0 Not pressed
1 Pressed

?KeyLeftShift

This variable contains a value representing whether the left Shift key is pressed.

Value Description
0 Not pressed
1 Pressed

?KeyNumLock

This variable contains a value representing whether Num Lock is on.

Value Description
0 Off
1 On

?KeyPressed

This variable contains a value representing the last key pressed. The value of this variable is the numeric equivalent of the key. If the key has been remapped in Keyboard Layout, this variable returns the value of the remapped key function.

?KeyRightShift

This variable contains a value representing whether the right Shift key is pressed.

Value Description
0 Not pressed
1 Pressed

?KeyScrollLock

This variable contains a value representing whether Scroll Lock is on.

Value Description
0 Off
1 On

?Language

This variable contains a value representing the current language. The value of this variable is a Corel WordPerfect language code. For example, if the current language is U.S. English, the value is US.

?LeftChar

This variable contains the character immediately to the left of the cursor. If no character occurs at the left of the cursor, the variable returns nothing.

?LeftCode

This variable contains a value representing the code immediately to the left of the cursor. The value of this variable is the numeric equivalent of the code. For a list of values returned by this variable, see Appendix C: Code Values for ?LeftCode and ?RightCode. If no code occurs at the left of the cursor, the variable returns 0.

?Line

This variable contains a value representing the distance of the cursor from the top of a page. The value of this variable is a measurement expression using the current unit of measure.

?LineSegmentBlue

This variable contains a value representing the amount of blue in a table line segment color. Values range from 0 to 255, with 0 indicating no blue and 255 indicating solid blue. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentBlue)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentCount

This variable contains the number of line segments in a line style. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands.

For Example

LineStyleEdit("Line Style")
Type(?LineSegmentCount)
LineStyleEnd(Save!)

?LineSegmentCustomCount

This variable contains the number of line segments in a custom-made line style. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands.

For Example

LineStyleEdit("My Style")
Type(?LineSegmentCustomCount)
LineStyleEnd(Save!)

?LineSegmentCustomData

This variable contains the dash length for a line segment in a custom pattern. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentCustomData)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentGreen

This variable contains a value representing the amount of green in a line segment color. Values range from 0 to 255, with 0 indicating no green and 255 indicating solid green. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentGreen)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentRed

This variable contains a value representing the amount of red in a line segment color. Values range from 0 to 255, with 0 indicating no red and 255 indicating solid red. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentRed)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentShading

This variable contains a value representing the shade of a line segment color. Values range from 0 to 100, with 100 indicating the darkest shade of a color. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentShading)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentSpacing

This variable contains a value representing the amount of space between one stacked line segment and the next. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentSpacing)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentType

This variable contains a value representing whether a line segment type is predefined or customized. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

Value Description
0 Predefined type
1 Custom type

?LineSegmentWidth

This variable contains the thickness of a line segment. The value of this variable is a measurement expression using the current unit of measure. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentWidth)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?LineSegmentWPG2Pattern

This variable contains a value representing a predefined line segment pattern. The value of this variable is one of the enumerated types or numeric equivalents listed for the LineSegmentSetWPG2 command. This variable must be used between either LineStyleCreate or LineStyleEdit and LineStyleEnd commands, and between either LineSegmentCreate or LineSegmentEdit and LineSegmentEnd commands.

For Example

LineStyleEdit("My Style")
LineSegmentEdit(0)
Type(?LineSegmentWPG2Pattern)
LineSegmentEnd(Save!)
LineStyleEnd(Save!)

?List

This variable contains the number of items listed in the current dialog.

?MacroEdit

This variable contains a value representing whether the Macro Edit option is active.

Value Description
0 Not active
1 Active

?MacroPlaying

This variable contains a value representing whether a macro is playing.

Value Description
0 Not playing
1 Playing

?MacroRecord

This variable contains a value representing whether a macro is recording.

Value Description
0 Not recording
1 Recording

?MajorVersion

This variable contains the major version number of the current Corel WordPerfect version.

?MarginBottom

This variable contains a value representing the size of the bottom margin. The value of this variable is a measurement expression in the current unit of measure.

?MarginLeft

This variable contains a value representing the size of the left margin. The value of this variable is a measurement expression in the current unit of measure.

?MarginRight

This variable contains a value representing the size of the right margin. The value of this variable is a measurement expression in the current unit of measure.

?MarginTop

This variable contains a value representing the size of the top margin. The value of this variable is a measurement expression in the current unit of measure.

?MergeActive

This variable contains a value representing whether the Merge option is active.

Value Description
0 Not active
1 Active

?MinorVersion

This variable contains the minor version number of the current Corel WordPerfect version.

?MouseLastX

This variable contains a value representing the horizontal position of the mouse.

?MouseLastY

This variable contains a value representing the vertical position of the mouse.

?MouseLeft

This variable contains a value representing whether the left mouse button is pressed.

Value Description
0 Not Pressed
1 Pressed

?MouseLeftClick

This variable contains a value representing whether the left mouse button is clicked.

Value Description
0 Not clicked
1 Clicked

?MouseLeftDouble

This variable contains a value representing whether the left mouse button is double clicked.

Value Description
0 Not double clicked
1 Double clicked

?MouseMiddle

This variable contains a value representing whether the middle mouse button is pressed.

Value Description
0 Not pressed
1 Pressed

?MouseMiddleClick

This variable contains a value representing whether the middle mouse button is clicked.

Value Description
0 Not clicked
1 Clicked

?MouseRight

This variable contains a value representing whether the right mouse button is pressed.

Value Description
0 Not pressed
1 Pressed

?MouseRightClick

This variable contains a value representing whether the right mouse button is clicked.

Value Description
0 Not clicked
1 Clicked

?MouseRightDouble

This variable contains a value representing whether the right mouse button is double clicked.

Value Description
0 Not double clicked
1 Double clicked

?MoveMode

This variable contains a value representing whether Move Mode is active.

Value Description
0 Not active
1 Active

?Name

This variable contains the name of the current document.

?Network

This variable contains a value representing whether Corel WordPerfect is running on a network.

Value Description
0 Not on a network
1 On a network

?NetworkType

This variable contains a value representing the network type. The value of this variable is the number representing the network operating system.

?NotFound

This variable contains a value representing whether the object of the last search was not found.

Value Description
0 Found
1 Not found

?OriginalKey

This variable contains a value representing the last key pressed. The value of this variable is the numeric equivalent of the key. If the key has been remapped in Keyboard Layout, this variable returns the value of the original key function.

?OutlineBar

This variable contains a value representing whether the Outline Bar is displayed.

Value Description
0 Not displayed
1 Displayed

?Page

This variable contains the current page number.

?PageChapter

This variable contains the current chapter number.

?PageHeight

This variable contains the page height in the current unit of measurement. For example, an 8.5" x 11" page returns the value of 11".

?PageSecondary

This variable contains the current secondary page number.

?PageVolume

This variable contains the current volume number.

?PageWidth

This variable contains the page width in the current unit of measurement. For example, an 8.5" x 11" page returns a value of 8.5".

?Path

This variable contains the path of the current file.

?PathBackup

This variable contains the directory specified in Location of Files for Backup Files.

?PathGraphicsPersonal

This variable contains the directory specified in Location of Files for Graphics Files, Personal Path.

?PathMacroPersonal

This variable contains the directory specified in Location of Files for Macros/Keyboards/Button Bar, Personal Path.

?PathMacroShared

This variable contains the directory specified in Location of Files, Macros/Keyboards/Button Bar, Shared Path.

?PathPrinterPersonal

This variable contains the directory specified in Location of Files, Printer files, Personal Path.

?PathSetfile

This variable contains the .SET file path.

?PathShared

This variable contains the path and directory in which the .FIL file is located.

?PathUnshared

This variable contains the path and directory in which the overflow and temporary files are located.

?PathWritingToolsPersonal

This variable contains the directory specified in Location of Files Writing Tools, Main.

?Position

This variable contains a value representing the horizontal position of the cursor. The value of this variable is a measurement expression in the current unit of measure.

?PrintAbnormal

This variable contains a value representing whether the last print job was abnormally aborted. An abnormal abort may be generated by rebooting or turning off the computer while a print job is in progress. A normal abort is generated by choosing Cancel Job from the Control Printer dialog.

Value Description
0 Normal abort
1 Abnormal abort

?PrintAttempt

This variable contains a value representing whether a print attempt has been made.

Value Description
0 No attempt
1 Attempt

?PrintDownload

This variable contains a value representing whether a file is downloading to the printer.

Value Description
0 Not downloading
1 Downloading

?PrinterColorConfigured

This variable contains a value representing whether the current printer is configured for color.

Value Description
0 Not color
1 Can be color but may need to be configured
2 Color

?PrintGo

This variable contains a value representing whether Print Go is active.

Value Description
0 Not active
1 Active

?PrintNetworkDown

This variable contains a value representing whether a network error is preventing printing.

Value Description
0 No network error
1 Network error

?PrintNoChar

This variable contains a value representing whether no characters have been sent to the printer.

Value Description
0 Characters sent
1 No characters sent

?PrintProgress

This variable contains a value representing whether printing is in progress.

Value Description
0 Not in progress
1 In progress

?PullDownMenus

This variable contains a value representing whether Pull-Down Menus is active.

Value Description
0 Not active
1 Active

?QuickCorrect

This variable contains a value representing whether QuickCorrect(TM) is on or off.

Value Description
0 Off
1 On

?Random

This variable contains a random decimal number between 0 and 1.

?ReadOnlyDoc

This variable contains a value representing whether the current document is Read Only.

Value Description
0 Not Read Only
1 Read Only

?RevealCodesActive

This variable contains a value representing whether Reveal Codes is active.

Value Description
0 Not active
1 Active

?Ribbon

This variable contains a value representing whether Ribbon is active.

Value Description
0 Not active
1 Active

?RightChar

This variable contains the character at the cursor position. If no character occurs at the cursor position, the variable returns nothing.

?RightCode

This variable contains a value representing the code at the cursor position. The value of this variable is the numeric equivalent of the code. For a list of values returned by this variable, see Appendix C: Code Values for ?LeftCode and ?RightCode. If no code occurs at the cursor position, the variable returns 0.

?Row

This variable contains the current row number.

?RowHeader

This variable contains a value representing whether the current row is a header row.

Value Description
0 Not a header
1 Header

?Ruler

This variable contains a value representing whether or not the Ruler Bar(R) is displayed.

Value Description
0 Ruler is not displayed
1 Ruler is displayed

?ScreenHigh

This variable contains a value representing the current screen height, expressed in characters. The value of this variable is one less than the number of possible lines on a screen, since the count begins with 0.

?ScreenWide

This variable contains a value representing the current screen width, expressed in characters. The value of this variable is one less than the number of possible characters across the screen, since the count begins with 0.

?ShellVersionMajor

This variable contains the major version number of the current Corel Shell version.

?ShellVersionMinor

This variable contains the minor version number of the current Corel Shell version.

?SingleSmartQuote

This variable contains a value representing whether the Single Smart Quotes feature is on or off.

Value Description
0 Off
1 On

?SingleSpaceInSentence

This variable contains a value representing whether the feature to replace double spaces in sentences with single spaces is on or off.

Value Description
0 Off
1 On

?Substructure

This variable contains a value representing which substructure is active.

Value Description
1 Footnote
2 Endnote
3 Header A
4 Header B
5 Footer A
6 Footer B
7 Watermark A
8 Watermark B
9 ToA Full Form
10 Graphics Caption
11 Text Box
12 Equation
13 Comment
14 Envelope Mailing
15 Envelope Return
256 Initial Codes
256 Default Initial Codes
256 Style
256 Delay Codes
1024 Keyboard Macro Editor

?TableGotoEdit

This variable contains a value representing whether table edit mode is active immediately after closing the Create Table dialog box.

Value Description
0 Table edit mode not active
1 Table edit mode active

?TableLastCell

This variable contains a value representing whether the current cell is the last cell in a table.

Value Description
0 Not last cell
1 Last cell

?TempDocName

This variable contains the name of the current document when the document has been saved as a temporary file.

?TimeHour

This variable contains a value representing the current hour.

?TimeHundredth

This variable contains a value representing the current hundredth of a second.

?TimeMinute

This variable contains a value representing the current minute.

?TimeSecond

This variable contains a value representing the current second.

?TypeoverActive

This variable contains a value representing whether Typeover is active.

Value Description
0 Not active
1 Active

?Units

This variable contains a value representing the current unit of measurement as specified in Setup under Display/Entry of Numbers.

Value Description
" inches
i inches
c centimeters
m millimeters
p points
w 1200ths of an inch
u WordPerfect Corporation's WordPerfect 4.2 units (Lines/Columns)

?UseRegQuotesWithNumbers

This variable contains a value representing whether the Use Regular Quotes with Numbers feature is on or off.

Value Description
0 Off
1 On

?VerticalScrollBar

This variable contains a value representing whether the vertical scroll bar is displayed.

Value Description
0 Not displayed
1 Displayed

?WP51CursorMovement

This variable contains a value representing whether Corel WordPerfect 5.1 Cursor Movement is active.

Value Description
0 Not active
1 Active

Appendix

Appendix A: Keystroke Numeric Equivalents

This appendix lists the keystroke numeric equivalents for use in commands such as CHAR, LOOK, and PRESSKEY.

Keystroke Normal Ctrl Alt Shft
a 97 -8068 -548 65
b 98 -8155 -547 66
c 99 -8066 -546 67
d 100 -8051 -545 68
e 101 -8064 -544 69
f 102 -8063 -543 70
g 103 -8062 -542 71
h 104 -8061 -541 72
i 105 -8060 -540 73
j 106 -8059 -539 74
k 107 -8058 -538 75
l 108 -8057 -537 76
m 109 -8056 -536 77
n 110 -7045 -535 78
o 111 -8054 -534 79
p 112 -7466 -533 80
q 113 -8052 -532 81
r 114 -8165 -531 82
s 115 -8050 -530 83
t 116 -8049 -529 84
u 117 -8153 -528 85
v 118 -8047 -527 86
w 119 -8046 -526 87
x 120 -8045 -525 88
y 121 -8032 -524 89
z 122 -8043 -523 90
F1 -8158 -8124 -8136 -8148
F2 -8159 -8123 -8135 -8147
F3 -7832 -8122 -8134 -8146
F4 -8157 -8121 -8133 -8145
F5 -8156 -8120 -8132 -8144
F6 -8155 -8119 -8131 -8143
F7 -8154 -8118 -8130 -8142
F8 -8153 -8117 -8129 -8141
F9 -8152 -8116 -8128 -8140
F10 -8151 -8115 -8127 -8139
F11 -8134 -7759 -6774 -8046
F12 -8133 -7163 -7675 -7149
`~ 96 126
1 ! 49 -521 33
2 @ 50 (Compose) -520 64
3 # 51 -519 35
4 $ 52 -518 36
5 % 53 -517 37
6 ^ 54 -516 94
7 & 55 -515 38
8 * 56 -514 42
9 ( 57 -513 40
0 ) 48 -522 41
- _ 45 -8096 -8095 95
= + 61 -8085 43
\ | 92 -8041 124
(-) -8100 45
(+) -8101 -8086 43
[ { 91 -8042 123
] } 93 -8040 125
; : 59 58
' " 39 34
, < 44 60
. > 46 62
/ ? 47 63
Arrow Down -8166 -8092 -8088 -8166
Arrow Left -8167 -8108 -8091 -8167
Arrow Right -8168 -8109 -8090 -8168
Arrow Up -8169 -8093 -8089 -8169
Backspace -8112 -8110 -8112
Del -8111 -8083 -8111
End -8107 -8181 -8107
Enter -8182 -8097
Esc -8160 -8160 -8160 -8160
Home -8184 -8104 -8087 -8184
Ins -8099 -8082 -8099
PgDn -8102 -8180 -8102
PgUp -8103 -8105 -103
Tab -8183 -8098
Space Bar 32 32 32 32

Appendix B: Key Names (PAUSEKEY)

The WP51 Keyboard option is found under File, Setup, Environment. If this option is checked, use the "F1=Cancel" equivalents below; otherwise, use the "ESC=Cancel" equivalents. This appendix only applies to the [ORIGINAL] keyboard selection located under File, Setup, Keyboard Layout. Note that an asterisk next to a keystroke indicates that Num Lock must be turned off.

Keystroke WP51 Keyboard Key Names (F1=Cancel) WP62 Keyboard Key Names (ESC=Cancel)
Home HomeKey HomeKey
Tab TabKey TabKey
Enter EnterKey EnterKey
Ctrl+End DeleteToEndOfLine DeleteToEndOfLine
Ctrl+PgDn DeleteToEndOfPageDlg DeleteToEndOfPageDlg
Up UpArrow UpArrow
Right RightArrow RightArrow
Left LeftArrow LeftArrow
Down DownArrow DownArrow
Esc RepeatKey CancelKey
F1 CancelKey Help
F2 SearchDlg SearchDlg
F3 HelpF4 Indent
F5 ListKey ListKey
F6 BoldKey BoldKey
F7 ExitDlg ExitDlg
F8 UnderlineKey UnderlineKey
F9 EndFieldKey EndFieldKey
F10 FileSaveDlg FileSaveDlg
F11 RevealCodesKey RevealCodesKey
F12 BlockKey BlockKey
Shift+F1 SetupKey SetupKey
Shift+F2 SearchBackwardDlg SearchBackwardDlg
Shift+F3 SwitchKey SwitchKey
Shift+F4 IndentLeftRight IndentLeftRight
Shift+F5 DateDlg DateDlg
Shift+F6 Center Center
Shift+F7 PrintDlg PrintDlg
Shift+F8 FormatDlg FormatDlg
Shift+F9 MergeCodesDlg MergeCodesDlg
Shift+F10 FileOpenDlg FileOpenDlg
Shift+F11 WPCharDlg WPCharDlg
Shift+F12 BookmarkDlg BookmarkDlg
Alt+F1 WritingToolsDlg WritingToolsDlg
Alt+F2 ReplaceDlg ReplaceDlg
Alt+F3 RevealCodesKey RevealCodesKey
Alt+F4 BlockKey BlockKey
Alt+F5 MarkTextDlg MarkTextDlg
Alt+F6 FlushRight FlushRight
Alt+F7 ColumnsTablesDlg ColumnsTablesDlg
Alt+F8 StyleDlg StyleDlg
Alt+F9 GraphicsDlg GraphicsDlg
Alt+F10 MacroPlayDlg MacroPlayDlg
Alt+F11 TableEditDlg TableEditDlg
Alt+F12 EnvelopeDlg EnvelopeDlg
Ctrl+F1 ShellDlg ShellDlg
Ctrl+F2 SpellerDlg SpellerDlg
Ctrl+F3 RewriteKey RewriteKey
Ctrl+F4 MoveDlg MoveDlg
Ctrl+F5 OutlineDlg OutlineDlg
Ctrl+F6 TabDecimal TabDecimal
Ctrl+F7 NotesDlg NotesDlg
Ctrl+F8 FontDlg FontDlg
Ctrl+F9 MergeSortDlg MergeSortDlg
Ctrl+F10 MacroRecordDlg MacroRecordDlg
Ctrl+F11 TabDlg TabDlg
Ctrl+F12 Save Save
Backspace DeleteCharPrevious DeleteCharPrevious
Del DeleteCharNext DeleteCharNext
Ctrl+Backspace DeleteWord DeleteWord
Ctrl+Right PosWordNext PosWordNext
Ctrl+Left PosWordPrevious PosWordPrevious
End PosLineEnd PosLineEnd
Ctrl+PgUp MacroControlDlg MacroControlDlg
Ctrl+Home GoToKey GoToKey
Page Up PageUp PageUp
Page Down PageDown PageDown
+(number pad)* PosScreenDown PosScreenDown
-(number pad)* PosScreenUp PosScreenUp
Insert TypeoverKey TypeoverKey
Shift+Tab ShiftTabKey ShiftTabKey
Ctrl+Enter HardPageBreakKey HardPageBreakKey
Ctrl+- SoftHyphen SoftHyphen
Alt+- MinusSign MinusSign
Ctrl+Up ParagraphUp ParagraphUp
Ctrl+Down ParagraphDown ParagraphDown
Alt+Left ItemLeft ItemLeft
Alt+Right ItemRight ItemRight
Alt+Up ItemUp ItemUp
Alt+Down ItemDown ItemDown
Alt+Home AltHome AltHome
Ctrl++(num pad) CtrlNumPlus CtrlNumPlus
Alt+= AltEqual AltEqual
Ctrl+Del CtrlDelKey CtrlDelKey
Ctrl+Insert CtrlInsKey CtrlInsKey

Appendix C: Code Values for ?LeftCode and ?RightCode

This appendix lists the values returned by the ?LeftCode and ?RightCode system variables. The codes are listed in decreasing numerical order.

Value Code Description
-32512 [HSpace] Hard Space
-32256 [- Soft Hyphen] Soft Hyphen
-31744 [- Hyphen] Hyphen
-31232 [Hyph SRt] Hyphenation Soft Return
-30976 [Dorm HRt] Dormant Hard Return
-30464 [End Cntr/Align] End of Centering/Alignment
-28672 [Cancel Hyph] Cancel Hyphenation of Word
-28416 [Do Subtot] Calculate Subtotal (Math)
-28160 [Subtot Entry] Subtotal Entry (Math)
-27904 [Do Total] Calculate Total (Math)
-27648 [Total Entry] Total Entry (Math)
-27392 [Do Grand Tot] Calculate Grand Total (Math)
-26880 [Math Neg] Math Negate
-18176 [THRt] Temporary Hard Return
-12287 [SRt] Soft Return
-12285 [SRt-SPg] Soft Return-Soft Page Break
-12284 [HRt] Hard Return
-12282 [HRt-SPg] Hard Return-Soft Page Break
-12281 [HCol] Hard Column Break
-12280 [HCol-SPg] Hard Column Break-Soft Page Break
-12279 [HPg] Hard Page Break
-12278 [Cell] Table Cell
-12277 [Row] Table Row
-12276 [Row-SCol] Table Row-Soft Column Break
-12275 [Row-SPg] Table Row-Soft Page Break
-12274 [HRow-HCol] Hard Table Row-Hard Column Break
-12272 [HRow-HPg] Hard Table Row-Hard Page Break
-12271 [Tbl Off] Table Off
-12269 [Tbl Off-SPg] Table Off-Soft Page Break
-12268 [TSRt] Temporary Soft Return
-12266 [TSRt-SPg] Temporary Soft Return-Soft Page Break
-12032 [Top Mar] Top Margin
-12031 [Bot Mar] Bottom Margin
-12030 [Suppress] Suppress Header, Footer, Watermark, or Page Number
-12029 [Pg Num Pos] Page Number Position
-12028 [Cntr Cur Pg] Center Current Page (Top to Bottom)
-12027 [Cntr Pgs] Center Pages (Top to Bottom)
-12026 [Wid/Orph] Widow/Orphan Protect State
-12025 [Footnote Space] Footnote Spacing
-12024 [Endnote Space] Endnote Spacing
-12023 [Footnote Min] Footnote Minimum Amount
-12022 [Endnote Min] Endnote Minimum Amount
-12021 [Footnote Num Each Pg] Restart Footnote Numbers Each Page
-12020 [Footnote Cont Msg] Footnote Continued Message
-12018 [Footnote Sep Ln] Footnote Separator Line
-12017 [Binding Width] Binding Width
-12016 [Pg Border] Page Border
-12015 [Paper Sz/Typ] Paper Size and Type
-12014 [Labels Form] Labels Form
-12013 [Dbl-Sided Print] Double-Sided Printing
-12012 [Subdivided Pg] Subdivided Page
-12011 [Delay] Delay
-12008 [Pg Num Fmt] Page Number Format
-12006 [Header Sep] Header Separator Space
-12005 [Footer Sep] Footer Separator Space
-11776 [Lft Mar] Left Margin
-11775 [Rgt Mar] Right Margin
-11774 [Col Def] Column Definition
-11773 [Col Border] Column Border
-11520 [Ln Height] Line Height
-11519 [Ln Spacing] Line Spacing
-11518 [Lft HZone] Left Edge of Hyphenation Zone
-11517 [Rgt HZone] Right Edge of Hyphenation Zone
-11516 [Tab Set] Tab Set
-11515 [Just] Justification
-11514 [Hyph] Hyphenation State
-11513 [Leading Adj] Leading Adjustment
-11512 [Begin Gen Txt] Beginning of Generated Text
-11511 [End Gen Txt] End of Generated Text
-11510 [Para Spacing] Paragraph Spacing
-11509 [First Ln Ind] First Line Indent
-11508 [Lft Mar Adj] Left Margin Adjustment
-11507 [Rgt Mar Adj] Right Margin Adjustment
-11506 [Outline] Outline
-11505 [Para Border] Paragraph Border
-11504 [Math Def] Definition of Math Columns
-11503 [Math] Math State
-11502 [Ln Num] Line Numbering
-11501 [Force] Force Odd/Even Page
-11500 [Endnote Placement] Endnote Placement
-11498 [Def Mark] Definition Marker for Index, List, Tbl. Contents/Authorities
-11264 [Dec/Align Char] Decimal/Alignment Character
-11263 [Thousands Char] Thousands Character
-11262 [Undrln Space] Underline Spaces
-11261 [Undrln Tab] Underline Tabs
-11260 [HAdv] Horizontal Advance
-11259 [VAdv] Vertical Advance
-11258 [Index] Index Entry
-11257 [ToA] Table of Authorities Entry
-11256 [Target] Target (Cross-Reference)
-11255 [Subdoc] Subdocument (Master Document)
-11254 [Mrk Txt ToC Begin] Beginning of Table of Contents Entry
-11253 [Mrk Txt ToC End] End of Table of Contents Entry
-11252 [Mrk Txt List Begin] Beginning of List Entry
-11251 [Mrk Txt List End] End of List Entry
-11250 [Subdoc Begin] Beginning of Subdocument
-11249 [Subdoc End] End of Subdocument
-11243 [Ptr Cmnd] Printer Command
-11242 [Kern] Kerning
-11241 [Block] Block
-11240 [Color] Text Color
-11238 [Font] Font
-11237 [Font Size] Font Size
-11236 [Lang] Language
-11235 [Comment] Document Comment
-11234 [Dot Lead Char] Dot Leader Character
-11233 [Condl EOP] Conditional End of Page
-11232 [Date] Date/Time Function
-11230 [Date Fmt] Date/Time Format
-11229 [Wrd/Ltr Spacing] Word Spacing and Letterspacing
-11228 [Just Lim] Word Spacing Justification Limits
-11227 [Bookmark] Bookmark
-11226 [Block Pro On] Block Protect On
-11225 [Block Pro Off] Block Protect Off
-11224 [Pause Ptr] Pause Printer
-11223 [Ovrstk] Overstrike
-11222 [Tbl Def] Table Definition
-11219 [Speller/Grammatik] Speller/Grammatik(R) State
-11218 [Filename] Filename
-11216 [Bar Code] Bar Code
-11214 [Para Num] Paragraph Number
-11212(r)
-11211(l)
[Hypertext Begin] Hypertext Begin
-11210(r)
-11209(l)
[Hypertext End] Hypertext End
-11206 [Link] Spreadsheet Link
-11205 [Link End] Spreadsheet Link End
-11202(r)
-11201(l)
[Macro Func] Macro Function
-11200 [Formatted Pg Num] Formatted Page Number
-11198 [Hidden On] Hidden Text On
-11198 [Hidden Txt] Hidden Body Text (Outline)
-11197 [Hidden Off] Hidden Text Off
-11196 [Flt Cell Begin] Floating Cell Begin
-11195 [Flt Cell End] Floating Cell End
-11008 [Ref Count] Reference to Counter
-11006 [Ref Box] Reference to Graphics Box
-11004 [Ref Pg] Reference to Page
-11002 [Ref Sec Pg] Reference to Secondary Page
-11000 [Ref Chap] Reference to Chapter
-10998 [Ref Vol] Reference to Volume
-10996 [Ref Para] Reference to Paragraph
-10994 [Ref Footnote] Reference to Footnote
-10992 [Ref Endnote] Reference to Endnote
-10752 [Header A] Header A
-10751 [Header B] Header B
-10750 [Footer A] Footer A
-10749 [Footer B] Footer B
-10748 [Watermark A] Watermark A
-10747 [Watermark B] Watermark B
-10496 [Footnote] Footnote
-10494 [Endnote] Endnote
-10240 [Count Set] Counter Set
-10238 [Pg Num Set] Page Number Set
-10237 [Sec Pg Num Set] Secondary Page Number Set
-10236 [Chap Num Set] Chapter Number Set
-10235 [Vol Num Set] Volume Number Set
-10234 [Para Num Set] Paragraph Number Set
-10233 [Footnote Num Set] Footnote Number Set
-10232 [Endnote Num Set] Endnote Number Set
-10231 [Ln Num Set] Line Number Set
-9984 [Count Meth] Counter Method
-9982 [Pg Num Meth] Page Numbering Method
-9981 [Sec Pg Num Meth] Secondary Page Numbering Method
-9980 [Chap Num Meth] Chapter Numbering Method
-9979 [Vol Num Meth] Volume Numbering Method
-9977 [Footnote Num Meth] Footnote Numbering Method
-9976 [Endnote Num Meth] Endnote Numbering Method
-9975 [Ln Num Meth] Line Numbering Method
-9728 [Count Disp] Counter Display
-9724 [Pg Num Disp] Page Number Display
-9722 [Sec Pg Num Disp] Secondary Page Number Display
-9720 [Chap Num Disp] Chapter Number Display
-9718 [Vol Num Disp] Volume Number Display
-9714 [Footnote Num Disp] Footnote Number Display
-9712 [Endnote Num Disp] Endnote Number Display
-9472 [Count Inc] Counter Increment
-9470 [Pg Num Inc] Page Number Increment
-9469 [Sec Pg Num Inc] Secondary Page Number Increment
-9468 [Chap Num Inc] Chapter Number Increment
-9467 [Vol Num Inc] Volume Number Increment
-9465 [Footnote Num Inc] Footnote Number Increment
-9464 [Endnote Num Inc] Endnote Number Increment
-9216 [Count Dec] Counter Decrement
-9214 [Pg Num Dec] Page Number Decrement
-9213 [Sec Pg Num Dec] Secondary Page Number Decrement
-9212 [Chap Num Dec] Chapter Number Decrement
-9211 [Vol Num Dec] Volume Number Decrement
-9209 [Footnote Num Dec] Footnote Number Decrement
-9208 [Endnote Num Dec] Endnote Number Decrement
-8960(r)
-8959(l)
[Char Style On] Character Style On
-8958 [Char Style Off] Character Style Off
-8956(r)
-8955(l)
-8954(on codes)
[Para Style] Paragraph Style
-8952(r)
-8951(l)
[Para Style End] Paragraph Style End
-8950 [Open Style] Open Style
-8704 [MRG:BEEP]
-8703 [MRG:BREAK]
-8702 [MRG:CANCELOFF]
-8701 [MRG:CANCELON]
-8700 [MRG:CONTINUE]
-8699 [MRG:DATE]
-8698 [MRG:DEFAULT]
-8697 [MRG:DISPLAYSTOP]
-8696 [MRG:ELSE]
-8695 [MRG:ENDSWITCH]
-8694 [MRG:ENDFIELD]
-8693 [MRG:ENDFOR]
-8692 [MRG:ENDIF]
-8691 [MRG:ENDRECORD]
-8690 [MRG:ENDWHILE]
-8689 [MRG:NEXT]
-8688 [MRG:NEXTRECORD]
-8687 [MRG:PAGEOFF]
-8686 [MRG:PAGEON]
-8685 [MRG:PRINT]
-8684 [MRG:QUIT]
-8683 [MRG:PROCESSON]
-8682 [MRG:RETURN]
-8681 [MRG:RETURNCANCEL]
-8680 [MRG:RETURNERROR]
-8679 [MRG:REWRITE]
-8678 [MRG:STEPOFF]
-8677 [MRG:STEPON]
-8676 [MRG:STOP]
-8675 [MRG:PROCESSOFF]
-8656 [MRG:ASSIGN]
-8655 [mrg:assign]
-8654 [MRG:CALL]
-8653 [mrg:call]
-8652 [MRG:CAPS]
-8651 [mrg:caps]
-8650 [MRG:SWITCH]
-8649 [mrg:switch]
-8648 [MRG:CASEOF]
-8647 [mrg:caseof]
-8646 [MRG:CHAINMACRO]
-8645 [mrg:chainmacro]
-8644 [MRG:CHAINDATA]
-8643 [mrg:chaindata]
-8642 [MRG:CHAINFORM]
-8641 [mrg:chainform]
-8640 [MRG:CHAR]
-8639 [mrg:char]
-8638 [MRG:CODES]
-8637 [mrg:codes]
-8636 [MRG:COMMENT]
-8635 [mrg:comment]
-8634 [MRG:CTON]
-8633 [mrg:cton]
-8632 [MRG:DOCUMENT]
-8631 [mrg:document]
-8630 [MRG:EMBEDMACRO]
-8629 [mrg:embedmacro]
-8628 [MRG:FIELD]
-8627 [mrg:field]
-8626 [MRG:FIELDNAMES]
-8625 [mrg:fieldnames]
-8624 [MRG:FIRSTCAP]
-8623 [mrg:firstcap]
-8622 [MRG:FORNEXT]
-8621 [mrg:fornext]
-8620 [MRG:FOREACH]
-8619 [mrg:foreach]
-8618 [MRG:GETSTRING]
-8617 [mrg:getstring]
-8616 [MRG:GO]
-8615 [mrg:go]
-8614 [MRG:IF]
-8613 [mrg:if]
-8612 [MRG:IFBLANK]
-8611 [mrg:ifblank]
-8610 [MRG:IFEXISTS]
-8609 [mrg:ifexists]
-8608 [MRG:IFNOTBLANK]
-8607 [mrg:ifnotblank]
-8606 [MRG:INSERT]
-8605 [mrg:insert]
-8604 [MRG:KEYBOARD]
-8603 [mrg:keyboard]
-8602 [MRG:LABEL]
-8601 [mrg:label]
-8600 [MRG:ASSIGNLOCAL]
-8599 [mrg:assignlocal]
-8598 [MRG:LOOK]
-8597 [mrg:look]
-8596 [MRG:MRGCMND]
-8595 [mrg:mrgcmnd]
-8594 [MRG:NESTDATA]
-8593 [mrg:nestdata]
-8592 [MRG:NESTFORM]
-8591 [mrg:nestform]
-8590 [MRG:NESTMACRO]
-8589 [mrg:nestmacro]
-8588 [MRG:NTOC]
-8587 [mrg:ntoc]
-8586 [MRG:ONCANCEL]
-8585 [mrg:oncancel]
-8584 [MRG:ONERROR]
-8583 [mrg:onerror]
-8582 [MRG:PROMPT]
-8581 [mrg:prompt]
-8580 [MRG:STATUSPROMPT]
-8579 [mrg:statusprompt]
-8578 [MRG:STRLEN]
-8577 [mrg:strlen]
-8576 [MRG:STRPOS]
-8575 [mrg:strpos]
-8574 [MRG:SUBSTDATA]
-8573 [mrg:substdata]
-8572 [MRG:SUBSTFORM]
-8571 [mrg:substform]
-8570 [MRG:SUBSTR]
-8569 [mrg:substr]
-8568 [MRG:SYSTEM]
-8567 [mrg:system]
-8566 [MRG:TOLOWER]
-8565 [mrg:tolower]
-8564 [MRG:TOUPPER]
-8563 [mrg:toupper]
-8562 [MRG:VARIABLE]
-8561 [mrg:variable]
-8560 [MRG:WAIT]
-8559 [mrg:wait]
-8558 [MRG:WHILE]
-8557 [mrg:while]
-8556 [MRG:POSTNET]
-8555 [mrg:postnet]
-8447 [Box (Para)]
-8445 [Graph Line] Graphics Line
-8192 [Back Tab] Back Tab (Margin Release)
-8176 [LFT TAB] Hard Left-Aligned Tab
-8175 [Lft Tab] Left-Aligned Tab
-8174 [LFT TAB (DOT)] Hard Left-Aligned Tab with Dot Leader
-8173 [Lft Tab (Dot)] Left-Aligned Tab with Dot Leader
-8144 [Lft Indent] Left Indent
-8136 [Lft/Rgt Indent] Left and Right (Double) Indent
-8128 [Cntr on Mar] Center on Margins
-8126 [Cntr on Mar (Dot)] Center on Margins with Dot Leader
-8120 [Cntr on Cur Pos] Center on Cursor Position
-8112 [CNTR TAB] Hard Centered Tab
-8111 [Cntr Tab] Centered Tab
-8110 [CNTR TAB (DOT)] Hard Centered Tab with Dot Leader
-8109 [Cntr Tab (Dot)] Centered Tab with Dot Leader
-8064 [Flsh Rgt] Flush Right
-8062 [Flsh Rgt (Dot)] Flush Right with Dot Leader
-8048 [RGT TAB] Hard Right-Aligned Tab
-8047 [Rgt Tab] Right-Aligned Tab
-8046 [RGT TAB (DOT)] Hard Right-Aligned Tab with Dot Leader
-8045 [Rgt Tab (Dot)] Right-Aligned Tab with Dot Leader
-7984 [DEC TAB] Hard Decimal-Aligned Tab
-7983 [Dec Tab] Decimal-Aligned Tab
-7982 [DEC TAB (DOT)] Hard Decimal-Aligned Tab with Dot Leader
-7981 [Dec Tab (Dot)] Decimal-Aligned Tab with Dot Leader
-3584 [Ext Large On] Extra Large Font Size On
-3583 [Very Large On] Very Large Font Size On
-3582 [Large On] Large Font Size On
-3581 [Small On] Small Font Size On
-3580 [Fine On] Fine Font Size On
-3579 [Suprscpt On] Superscript On
-3578 [Subscpt On] Subscript On
-3577 [Outln On] Outline On (Font Attribute)
-3576 [Italc On] Italics On
-3575 [Shadw On] Shadow On
-3574 [Redln On] Redline On
-3573 [Dbl Und On] Double Underline On
-3572 [Bold On] Bold On
-3571 [StkOut On] Strikeout On
-3570 [Und On] Underline On
-3569 [Sm Cap On] Small Caps On
-3328 [Ext Large Off] Extra Large Font Size Off
-3327 [Very Large Off] Very Large Font Size Off
-3326 [Large Off] Large Font Size Off
-3325 [Small Off] Small Font Size Off
-3324 [Fine Off] Fine Font Size Off
-3323 [Suprscpt Off] Superscript Off
-3322 [Subscpt Off] Subscript Off
-3321 [Outln Off] Outline Off (Font Attribute)
-3320 [Italc Off] Italics Off
-3319 [Shadw Off] Shadow Off
-3318 [Redln Off] Redline Off
-3317 [Dbl Und Off] Double Underline Off
-3316 [Bold Off] Bold Off
-3315 [StkOut Off] Strikeout Off
-3314 [Und Off] Underline Off
-3313 [Sm Cap Off] Small Caps Off

Appendix D: List of Shipping Macros

The following predefined Corel 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 DROPCAP.WPM, EXITALL.WPM, and LIBRARY.WPM are also on the MACROS Button Bar (see Setup: Keyboard Layout and Button Bar in Corel WordPerfect 6.2 for DOS User's Guide 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.
CALENDAR.WPM
This macro displays a dialog box that lets you create one or more monthly calendars for a specific year. The calendars can be created in portrait or landscape orientation.
EXITALL.WPM
This macro returns you to the main editing screen from any subscreen or dialog, such as the footnote editing screen. However, in order for the macro to work when you're in a dialog, you must first select the MACROS keyboard.
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 E: Converting 5.1 Macros to 6.2

This appendix provides basic information and the syntax required to use the Macro Conversion Utility (MCV.EXE). For more detailed information on macro conversion and error messages see the file contained in your WP62 directory named README.MCV.

Conversion Utility

Macros are converted from 5.1 to 6.2 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. The utility also accepts a number of startup options.

Startup Option Examples

Two startup options, /w and /u, exist for converting macros that will function both in Corel WordPerfect 6.2 for DOS and Corel WordPerfect 6.0/6.1 for Windows. Specifying /w as the startup option will convert a 5.1 macro to 6.x commands that are available in both DOS and Windows. The startup option /u can be used in combination with /w to specify the unit of measurement for use specifically in Windows macros. For example, to convert a macro to 6.1/6.2 DOS and Windows commands and to specify inches as the unit of measurement, type:

MCV /w /u-i c:\wp51\macros\letter.wpm c:\corel\wp62\macros\letter.wpm

Note that the extension of the macro would need to be changed to .WCM to run in Windows.

The conversion utility also accepts a number of other startup options. For example, to display the conversion help screen, type:

MCV /h

Or, to remove quotation marks from text strings while converting a 5.1 macro named LIST.WPM to a 6.2 DOS macro named NEWLIST.WPM, type:

MCV /q c:\wp51\macros\list.wpm c:\corel\wp62\macros\newlist.wpm

Or, to convert all 5.1 macros in a specific directory and place them in a 6.2 DOS directory (macros will retain original names), type:

MCV c:\wp51\macros\*.wpm c:\corel\wp62\macros

Canceling a Conversion

To cancel the conversion at any point, press ESC, Cancel, Exit, or Ctrl+Break. The conversion will quit after converting the current file.

Memory Requirements

MCV.EXE requires approximately 494K of conventional memory.

Syntax and Parameters

Syntax

MCV /Options Source Destination

Parameters
Options (optional)
Option Description
/b Indicates that the 5.1 macro is designed to execute with Block on. The 6.2 macro resulting from this conversion will execute properly only if 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.2 macro command abbreviations.
/w Converts to macro commands available in both DOS and Windows.
/u-unit Specifies the unit of measurement to use in a Windows macro. The options for "unit" are i, c, p. This startup option does not have to be used with /w. If used on its own, /u will set the unit of measurement for 6.2 DOS macros.
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.

Glossary/Index

Glossary

active
An application, document window, or dialog box that is currently in use.
character expression
A series of one or more Corel 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 be recompiled 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 Corel 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 some product commands can accept only certain predefined 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 Corel 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, followed by an optional unit of measurement character (such as ", c, p, or u). If a unit of measurement character is not specified, the program's current unit of measurement will be used. Do not enclose a measurement expression in quotation marks.

Unit of measurement characters are listed below:

Abbreviation Unit
" or i inches
c centimeters
m millimeters
p points
w 1200ths of an inch
u WordPerfect Corporation's WordPerfect 4.2 units (lines/columns)
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 "address" that tells a computer where to locate a directory or file on a disk or network. A path includes the drive, the root directory, and any subdirectory names that branch from the root directory. Directory names are separated by a backslash (\). For example, in C:\COREL\WP62\LETTERS\MYLETTER.ANN, C:\COREL\WP62\LETTERS is the path to the filename MYLETTER.ANN. The file is located in the LETTERS subdirectory in the WP62 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 Corel WordPerfect window that lists the current font and the position of your cursor.
text file
A file saved in ASCII (DOS text) format. 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.

Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

About this document

This document contains the same text as distributed by Corel Corporation Limited for WP 6.2 Macros in electronic form. It was created on 12/19/96 using the Folio VIEWS v2.0 product, and converted to HTML format in 2020, with minor modifications to the tables of contents to ease navigability, adding back bits of missing text from the WP 6.2 online help. Later on, I have added comments, or additional information, clearly marked like this where the original text was insufficiently clear, or missing some important bit of information.

Any link entries in the index of this manual not matching exactly a programming command or variable name may be off by a couple of sections.