Application 2: Merging from the Keyboard

In this application: KEYBOARD

You may have a form that you need to fill in periodically, but don't need or want to create a merge data file to merge it with. A keyboard merge can be used to create one or more documents at a time. During a keyboard merge, the cursor stops at each position where information needs to be entered and lets you type your information. Then you simply press End Field and the cursor jumps to the next position where you need to add information. The information that is in the form file will be included in the final merged document, as well as the information you add during the merge.

KEYBOARD(message)

To create a keyboard merge form file, first type the basic text of your form. When your form is done, save it. Now add the KEYBOARD commands at the positions where you want the merge to stop and allow you to input information. Example 2-1 shows a simple keyboard merge form file for creating a memo.

TO: KEYBOARD()
CC: KEYBOARD()
FROM: KEYBOARD()
DATE: DATE

RE: KEYBOARD()

*********************************************

KEYBOARD()

Example 2-1 MEMO.FRM A simple keyboard merge form file

The KEYBOARD command can include text to be displayed in its parameter. This text can instruct the user about what type of information is expected. KEYBOARD commands can be mixed with field and other merge commands in the same form file.

When you merge a form file with KEYBOARD commands, the merge will stop at the command, allowing the user to enter text. The message that is specified in the command will be displayed in a dialog on screen. Text from the form file will also be displayed, up to the next KEYBOARD command, or up to 1000 characters.

Exercise 2-1 Creating a Fill-in letter with the KEYBOARD command

Create the form file below and name it APP2A.FRM.

FIELD(name)
FIELD(address)
FIELD(city), FIELD(state) FIELD(zip)

DATE

Dear FIELD(salutation)

Thank you for your order for KEYBOARD(). Your order will
be shipped on or before KEYBOARD(). Please feel free to
contact us with any questions or comments.



Sincerely,



John Doe

Clear your screen, and then merge it with LESSON2.DAT. When the merge reaches the KEYBOARD command, it will stop, allowing you to type in the needed information. Type an item name.

To end the KEYBOARD pause and move on to the next item, press End Field (Alt+Enter). The merge will continue until you have merged all the records in the data file, stopping on each letter to allow you to enter the item name and the shipment date.

>To end the KEYBOARD pause in WordPerfect for DOS, press End Field (F9).

A user may not always be able to remember (or determine from context) what s/he should type when the merge pauses for input. Unless the line of text before the KEYBOARD command gives a hint of what should be typed, you could find yourself typing the wrong information. To alleviate this, specify a message with the KEYBOARD command's parameter.

Exercise 2-2 Using a message with KEYBOARD

Open the file APP2A.FRM that you created in Exercise 2-1. Alter the file so that it looks like Example 2-3 below.

FIELD(name)
FIELD(address)
FIELD(city), FIELD(state) FIELD(zip)

DATE

Dear FIELD(salutation):

Thank you for your order for KEYBOARD(Enter item name
(End Field to continue)). Your order will be shipped on
or before KEYBOARD(Enter Ship Date (End Field to
continue)). Please feel free to contact us with any
questions or comments.

Sincerely,



John Doe

Save the file as APP2B.FRM, clear your screen, and then merge it with LESSON2.DAT. When the merge reaches the first KEYBOARD command, it will stop, and you will see the message at the bottom of the screen telling you what needs to be input. It allows you to type in the needed information. When done entering the text, press End Field (Alt+Enter). The merge will continue until you have merged all the records in the data file, stopping on each letter to allow you to enter the item name and the shipment date.

You can create essentially any fill-in form you need and add KEYBOARD commands to it. You need not use any FIELD commands: the merge can be strictly from the keyboard. But you can mix and match FIELDand KEYBOARDcommands to get the information you need into the desired places.

Stopping a keyboard merge

There are two ways to stop a merge once you have it going. Press Close (Ctrl+F4), or choose File, then Close. A dialog box will appear that says "Merge in Progress. End it?" Choose Yes to end the merge.

The second way is to choose Tools, Merge, then Merge Codes. Next, select STOP.

Stopping a keyboard merge in WordPerfect for DOS

There are two ways to stop a keyboard merge once you have it going. Press Merge Codes (Shift+F9), and you will be given three choices: (1) Quit, (2) Next Record or (3) Stop. If you choose (1) Quit, merging will stop, and the information that has merged so far will be displayed on the screen, as well as the rest of the form file. You can save this file and merge it later to complete the merge.

If you choose (2) Next Record, the current record will be skipped. If you choose (3) Stop, the merge will stop exactly where your cursor is, with no additional information merging in past the cursor.

Even easier, simply press Exit (F7). You'll be asked to confirm that you want to end the merge. Answer Yes.

Merging multiple copies of a KEYBOARD form file

Normally if you merge with a data file, the form file is repeated once for each record. When you don't merge with a data file, only one copy of the form file is repeated. If you need to fill out several forms, it can be annoying to have to start a KEYBOARD merge over and over again. For example, if you need to generate a document for each of five clients, and you'll be entering their personal data from the keyboard during the merge, you'd have to start the merge five times to get the desired number of copies.

WordPerfect has a feature that lets you specify the number of copies of a merge document you want. To use this feature, start the merge as you normally would. Click Tools, Merge, Merge. Specify the form file name. Click the Options button. In the Number of copies for each record edit control, select the number of copies that you want. Click OK, then Merge. The document will be merged the number of times you specify.

 

 

 

 

 

 

 

Repeating a form file in WPDOS

To specify the number of copies you want of a form file in WPDOS, start the merge as you normally would. Press Merge/Sort (Ctrl+F9), (1) Merge. Specify the name of the form file. Press (4) Repeat Merge for Each Data Record, and type the number of copies you want. Press (Enter) to begin the merge.