|
|
HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 INTRODUCTION TO FORMS DESIGN FORMS FILE |
|
The forms file consists of "global" specifications that apply to all forms in the file, followed by the individual forms specification. Within each form specification, the form is identified, and its form layout is defined. The form layout defines each field into which data can be entered. Each of these different types of specification is entered on a menu displayed by FORMSPEC. (Refer to Figure 3-12 “Forms File Prototype” for an illustration of a prototype forms file.) At any time during forms design, you can change any form or field currently specified in the forms file. The function keys or the Main Menu allow you to return to any existing form or field specification. You can then simply change the field or form and press ENTER. The new specifications override those previously entered. Refer to "Ease of Forms Design" earlier in this section. Another method of modifying a form file is to use the delete option on Main Menu. This option allows you to delete an entire form or to delete fields global to all forms (save fields). When you delete a form, be sure to modify any other form that references the deleted form. For example, if FORM2 is given as the next form name for FORM I, and FORM2 is deleted, you must change the next form name specification on the menu for FORM1. Note that when you delete a parent form, all child forms of that form family will be deleted also. Refer to the "Main Menu" menu description and the "Form Families" discussion for more information. The processing specification copy function allows processing specifications to be copied from one field to another field within and across forms files. Processing specifications are entered from the Field Menu of the FORMSPEC utility. This function is also invoked interactively from the Field Menu. To use this function, enter one of the following commands in the first line of the processing specifications area in the Field Menu:
If processing specifications exist on the first line, press Insert Line before entering the command. After entering one of these commands, press F3 to execute the command.
When #COPYTO newfilename is executed, the processing specifications defined for the field are copied to the file specified by newfilename. As the template suggests, the file specified should be a new file. If there are no processing specifications to copy, the new file is not created. The command should then be deleted from the processing specifications area. If any error is encountered in executing the command, it is displayed in the upper area of the Field Menu screen. When #COPYFROM oldfilename is executed, the processing specifications (if any) in the file specified by oldfilename are copied into the processing specifications area of the field. Press Enter after the command executes (successfully) to save the copied processing specifications for the field. Since this command is used to retrieve the processing specifications, it cannot be used if specifications already exist for the field. If any error is encountered in executing the command, it is displayed in the upper area of the Field Menu screen. The copy option on the Main Menu provides yet another method of modifying a form file. This useful option allows you to copy an entire form from the current forms file or from another forms file. The copied form is created by FORMSPEC as a new form that is an exact replica of the existing form. The form being copied must be given a name unique to the current forms file. The copied form can then be displayed and modified to suit your design. The copy option does not copy save fields from one file to another; you must recreate the necessary save fields if you copy a form from a forms file other than the current file. Also, form family relationships are not maintained when forms are copied from one file to another. You may re-establish form family relationships using the relate option on the Main Menu. Refer to the "Main Menu" description for more information. Most of the modifications can also be made using FORMSPEC in batch mode. (See Section 7 for more information.) The following error messages may be displayed when executing the #COPYTO newfilename command:
The following error messages may be displayed when executing the #COPYFROM oldfilename command:
When a new file is created with the #COPYTO command, it is created in the permanent file domain. Using this file in a subsequent #COPYFROM command does not purge this file. Purge this file manually if it is no longer required. FORMSPEC indicates what percentage of the forms file is full whenever the Main Menu is displayed from the Forms File Menu. The percentage is determined by the formula:
This message is designed to give the user an idea of the space utilized in the forms file. Since a single forms file can contain an essentially unlimited number of forms (subject to system constraints), the forms file may reach its end-of-file (default=4000 records). When the percentage indicated on the Main Menu grows large, you should increase the size of your forms file, as described below. When you require the forms file to be larger than the default limit of 4000 records, you may override the FORMSPEC default size to create a new forms file using the MPE :FILE command. The :FILE command must be issued prior to the :RUN command to initiate FORMSPEC. Another method is to use the MPE :BUILD command to create a larger file and then use FCOPY to copy an existing forms file into the larger file. To use the :FILE command to create a forms file named ORDFORM, issue the file equation: :FILE ORDFORM;DISC=6000 Run FORMSPEC and specify ORDFORM as the forms file. You now have an empty file with room for 6000 records, into which you may add or copy forms using the FORMSPEC Main Menu options. Note that the FORMSPEC copy Main Menu option will not copy save fields from other forms files or maintain form family relationships across forms files. You may re-establish form family relationships using the FORMSPEC relate Main Menu option. Refer to the "Main Menu" description for more information. To use the :BUILD command to expand your forms file, ORDFORM, give the following command: :BUILD ORDFORM2;DISC=6000;REC=128,1,F,ASCII;CODE=VFORM Run FCOPY to copy the contents of ORDFORM into the larger file: :RUN FCOPY.PUB.SYS The forms defined through FORMSPEC are written to a forms file. The forms are initially stored as a "source" version. This source is modified if you change the forms file, but it must be compiled before it can be executed by an application, The compiled version, on the other hand, can be executed but not modified. The source version of the forms file is kept along with the compiled version for purposes of display and modification. Once modified, the source version must be recompiled before it can be executed. However, unless a global attribute of the forms file is modified, only those forms which were changed are actually recompiled. The global attributes include any save fields or the fields on the Globals Menu or the Terminal/Language Selection Menu. Note that the source version is the sequence of specification records entered on the menus. The compiled version is the sequence of forms displayed to the user. When your forms design is complete, you can compile the forms file to a "fast forms file". A fast forms file is similar to the forms file except that it is created with the smallest record size that can hold the largest form in the file. Also, it contains only the information that VPLUS needs at run-time, so it has fewer records. Because the record size and the number of records are minimal, such a forms file can improve performance at run-time. A fast forms file can only be executed; it cannot be modified. You may however always modify the source forms file and then recompile it to a fast forms file. The forms file can also be compiled using FORMSPEC in batch mode. (See Section 7 for more information.) FORMSPEC provides an option to renumber forms interactively. A new command has been added to the Interactive FORMSPEC to renumber forms. This command is invoked by selecting option "N" on the Main Menu. The form to be renumbered should be specified in the field next to the keyword "N". (This field is the same as where you would specify a form when also selecting the "D" option.) This option is equivalent to the RENUMBER command in batch mode FORMSPEC. Figure 3-13 “Forms File Listing” illustrates the listing for a forms file. Note that the listing includes the current status of the forms file, including when it was last modified and compiled, and the number of two-byte words of stack space needed by VPLUS when accessing this forms file at execution time. Forms can also be printed using FORMSPEC in batch mode. (See "Using FORMSPEC in Batch Mode", Section 7 for more information.) Consult Appendix E, for information regarding the file equations which VPLUS uses when listing forms files. |
|