HPlogo HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 INTRODUCTION TO FORMS DESIGN

FORMS FILE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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.)

Forms Modification

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.

Copying of Processing Specifications

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:

  • #COPYTO newfilename

  • #COPTFROM oldfilename

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.

NOTE: These commands are not case sensitive.

#COPYTO

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.

#COPYFROM

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.)

Error Messages

The following error messages may be displayed when executing the #COPYTO newfilename command:

  • If the file specified by newfilename already exists, the following message is displayed and no copying is done:

    File already exists!
  • If the syntax of the command is not proper, the following message is displayed:

    Check syntax: #COPYTO newfilename.
  • If the file attributes check for a new file results in an error, the following message is displayed:

    New file check failed!

    The specified file should be a non-existent permanent file.

  • If the file cannot be opened, the following message is displayed:

    Cannot create new file!

The following error messages may be displayed when executing the #COPYFROM oldfilename command:

  • If oldfilename cannot be opened, the following message is displayed:

    Unable to open old file!
  • If the syntax of the command is not proper, the following message is displayed:

    Check syntax: #COPYFROM oldfilename
  • If processing specifications exist for the field, the following message is displayed:

    Cannot do a #COPYFROM if proc specs already esist.

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.

Forms File Size

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:

file EOF / file limit

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.

Figure 3-12 Forms File Prototype

Forms File Prototype

Expand Forms File

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
^
desired disc space, in number of records

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

desired disc space

Run FCOPY to copy the contents of ORDFORM into the larger file:

:RUN FCOPY.PUB.SYS
>FROM=ORDFORM;TO=ORDFORM2

EOF FOUND IN FROMFILE AFTER RECORD 1015 <- FCOPY response

1016 RECORDS PROCESSED *** 0 ERRORS

Compiling the Forms File

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.)

Renumbering a Form with Interactive FORMSPEC

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.

Listing Forms

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.

Figure 3-13 Forms File Listing

Forms File Listing
Figure 3-13. Forms File Listing (Cont)
Forms File Listing
Feedback to webmaster