Most merges are straightforward operations: combining text from a data file with the text of a form file. There may be times, however, when you would like to display instructions or a message on the screen for the user. Several commands are available to do just that.
The PROMPT and STATUSPROMPT commands allow you to display a message on the screen. This lesson will cover these commands, and others that are commonly used with these commands.
The PROMPT command will display a message at the bottom of the document screen during a merge. PROMPT can be followed by a WAIT command to specify the length of time the message should remain on the screen.
Note: If you use a WAIT command, a distracting "Please Wait... Merging" message will be displayed in WPWin, so I recommend against using a WAIT command with a PROMPT.
Message: The message is displayed in a message box near the bottom of the screen. The message can be up to 128 characters when you first insert the PROMPT command. However, once the command has been inserted, you can edit the message and add additional text to your message.
PROMPT can also be followed by a KEYBOARD command to temporarily stop the merge and allow user input, although the effect is the same as if you used just a KEYBOARD command with a message. If used with a KEYBOARD command with no message, the PROMPT message will be displayed until you press End Field (Alt+Enter) or click Continue on the merge feature bar.
|
Prompt messages in WordPerfect for DOS
In WordPerfect for DOS, the PROMPT message is displayed on the Status Line. If you use PROMPT and KEYBOARD together, the PROMPT message will not be displayed. |
The KEYBOARD command is used when you want the merge to pause at a given point in the merge and allow user input. You can include a message with the KEYBOARD command, although it is not required. While the merge is paused at a KEYBOARD command, you can enter text on the screen, look at text, or revise information in the document. You can move up in the document as far as you'd like, or down as far as the next merge command.
Prompt: Specify the message that you want to appear on the screen. This parameter is optional. If you don't include a message, the merge will pause and allow the user to type text on the screen. The user must press End Field (Alt+Enter) or click Continue on the merge feature bar to resume the merge.
When you use a KEYBOARD command, a merge feature bar appears on the screen with options to Continue, Skip Record, Quit, or Stop the merge.
The KEYBOARD command can be quickly inserted in your merge file from the merge feature bar, or from the Insert Merge Codes dialog. Although the prompt message is optional, I recommend that you always add a message to the KEYBOARD command. The person who uses the merge file will appreciate the reminder of what should be typed, and how to continue to merge.
When a KEYBOARD command follows a PROMPT command, the message included in the KEYBOARD command will supersede the message included in the PROMPT command. The KEYBOARD message will persist on the screen until you press End Field (Alt+Enter).
See Application 2 for more examples of the KEYBOARD command.
Exercise 1-2 Using the KEYBOARD Command
Imagine you are making a merge file that will create an office memorandum. Click Tools, Merge, Form (Create Document in WPWin 8). If asked, choose New Document Window, then click OK. In the Create a Form File dialog (Associate a data file dialog in WPWin 8), select No assiciation (None in WPWin 6.1), then choose OK. Enter the commands below. Save the file as MEMO.FRM.
M E M O R A N D U M TO: KEYBOARD() FROM: KEYBOARD() DATE: DATE RE: KEYBOARD() * * * * * * * * * * * * * * * * * * * * * * * * * |
Now clear the screen and merge this file. You will see that the merge stops at each KEYBOARD command, allowing you to type in your information. Type the name of the recipient and press End Field (Alt+Enter). The merge will move to the FROM: line. Type the name of the memo's originator and press End Field (Alt+Enter). The merge will move to the RE: line. Type a subject and press End Field (Alt+Enter). The merge will move to the body of the memo. Type the body of the memo. When done, you can save or print the memo.
Now, clear the screen and retrieve MEMO.FRM again. Add messages to the KEYBOARD commands as shown below.
M E M O R A N D U M TO: KEYBOARD(Type recipient.(End Field)) FROM: KEYBOARD(Type sender.(End Field)) DATE: DATE RE: KEYBOARD(Type subject.(End Field)) * * * * * * * * * * * * * * * * * * * * * * * * * |
Now, when you run the MEMO.FRM merge, you will be prompted for the type of information to be filled in on the memo. Note that the message at the bottom of the screen disappears when you press End Field (Alt+Enter in WPWin, F9 in WPDOS)
The STATUSPROMPT command displays a message just like the PROMPT or KEYBOARD command does. It is included in WPWin for compatibility with WordPerfect for DOS, where it works slightly differently than a PROMPT.
Message: In the message parameter, specify the message to appear.
The STATUSPROMPT message appears in a merge message box toward the bottom of the screen. You can move it by clicking on the title bar and dragging it to a new location. You can enter up to 128 characters for the message when you first insert the STATUSPROMPT command. Once the command is inserted, you can edit it to add additional text. The STATUSPROMPT will be dismissed when the merge is completed, or when a new STATUSPROMPT overwrites it.
Exercise 1-3 The STATUSPROMPT Command
Create the following form merge file, STATPRO.FRM. Do not associate a data file.
STATUSPROMPT(This is a test of a merge Status Prompt) WAIT(50) |
Merge this file with no data file. The message will remain on the screen for a short time, then disappear.
|
The STATUSPROMPT in WordPerfect for DOS
The STATUSPROMPT message appears on the Status Line. It will persist on the screen after the merge is completed, unless another STATUSPROMPT command is used to overwrite it. To erase a STATUSPROMPT message, another STATUSPROMPT with no message is used. Generally, the STATUSPROMPT is used more often in the DOS version than in the Windows version. A STATUSPROMPT message will not overwrite the Status Line information (Doc 1 Pg 1 Ln 1" Pos 1"). |
Exercise 1-4 Using the STATUSPROMPT Command in WP for DOS
Create the following form merge file, STATPRO.FRM. Do not associate a data file.
STATUSPROMPT(This is a test of a merge Status Prompt.) |
When you merge this file, you will see that the message appears at the bottom of the screen. As soon as it does, the merge is complete, but the message will remain on the screen. You would need to either exit WordPerfect or run another merge with a blank STATUSPROMPT() command to erase the message. Now edit STATPRO.FRM and add a blank STATUSPROMPT() as shown below:
STATUSPROMPT(This is a test of a merge Status Prompt.) STATUSPROMPT() |
When you merge this new file, the message will be displayed for a short time (probably so fast you won't see it), then will disappear.
The WAIT command can be used to make a merge stop for a specified amount of time at any point in a merge. For instance, if you would like a message (PROMPT, STATUSPROMPT) to be displayed for a few seconds so the user can read it, insert a WAIT command just after the message.
10ths second: The length of time to wait is specified in tenths of a second. If you want a message displayed for ten seconds, for instance, the command WAIT(100) would be used. For five seconds, WAIT(50) would be specified.
The maximum time that one WAIT command can wait is 59 seconds; thus WAIT(590) will be the longest interval for one WAIT command. If more than 59 seconds is needed, use more than one WAIT command.
WAIT can be used after a PROMPT command to allow a message to be displayed long enough for a user to read it. Normally, five to ten seconds is sufficient for a short message, while a user may require more time to read a longer message.
In WordPerfect for Windows, the WAIT command causes a distracting "Please Wait .. Merging" message to appear in the middle of the screen, so you may not want to use this command often in WPWin.
In WordPerfect for DOS a WAIT command will usually cause a "Merging" message to appear on the Status Line, but this message will not interfere with PROMPT messages.
In merges that will display messages on the screen, you may want to use the BEEP to get the user's attention. For instance, when you have a KEYBOARD command to prompt for data entry, or want to display information about the progress of the merge, or need on-screen instructions, a user is more likely to respond to both a visual and an audible cue for action.
The BEEP command generates an audible beep from the computer. This, along with a message displayed on the screen, is sure to get the user's attention. Place the BEEP command just before your PROMPT, STATUSPROMPT, KEYBOARD, or other command where you would like a beep to be sounded.
Exercise 1-5 Using the BEEP Command
Edit the MEMO.FRM merge form you created in Exercise 1-1. Add a BEEP command just before each KEYBOARD command, as shown in the screen below.
M E M O R A N D U M TO: BEEP KEYBOARD(Enter recipient.(End Field)) FROM: BEEP KEYBOARD(Enter sender.(End Field)) DATE: DATE RE: BEEP KEYBOARD(Enter subject.(End Field)) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * BEEP |
Merge the file. You will now hear a beep, as well as see the message prompting you to enter information.
Remember, no one likes a pushy computer. Too many BEEPs during a merge can get annoying very quickly, so don't over-use this command (like we did in the example above). Use it only when needed. For example, if a portion of the merge may take a very long time (long enough for the user to take a short nap), and user input is required towards the end of the merge, you can add a BEEP to wake the user up when their attention is required.
![]()
1. How long can a single WAIT command wait?
![]()
DOS
![]()
![]()
![]()
![]()
![]()
![]()