4: Creating the Demonstration System Forms

4.5 Creating the Subscribers and Subscriptions Forms

The creation of a multiple-form formfile is the topic of this section. Our new formfile, subscrpt, will contain forms for entering subscribers as well as their subscriptions. Two RMSfiles are accessed by the subscrpt formfile. These are the subscriber file (sub) and the subscription file (script). This formfile is named subscrpt.

1. From the Data Entry Forms Menu, select choice 1 - Create a Data Entry Form.

When the system responds with the parameter form requesting the name of the formfile, enter subscrpt and press STORE <F5>.

The Form Description screen should then be displayed.

2. Press the ADD key <F6> and enter the information:

Note that the Next Form Name field identifies another form, subscriptions. The Repeating Form field is set to no and the Freeze Form field is set to yes. As each record is stored in the sub data file, the subscriptions form is displayed, with the subscribers form still frozen on the screen.

3. Press the STORE key <F5>, toolkit displays the development screen. After you completed the development screen.

4. To enter the background text for the form heading, position the cursor at column 1 of line 1 and type Subscribers.

5. To create the subscriber form field perform the following steps:

6. To create the name form field perform the following steps:

Each time you store or delete a record in a form, a copy of the record is saved with the form. Pressing the Line Feed key in a blank field copies the value from the corresponding field in the saved record to the current record. When you add field descriptions, a value from the last stored Field Description screen may be duplicated in the current screen by pressing the Line Feed key while the cursor is in that field. This feature is often helpful when entering the Entry Allowed, Input Required, InData File, and Invisible field values, since you can make the necessary entries without having to retype each individual value.

7. Perform the steps outlined in the following paragraphs to create the address field. Before actually creating this form field, however, we will first introduce a convention which must be used when creating or modifying C/Base forms that contain fields defined as arrays .

As you will recall, the address field was defined in the data dictionary of the RMSfile sub as an array having two elements. When referring to the elements of an array within a formfile, the element number must be identified. This is done by referencing the first element of the address field as address[1], the second element as address[2], and so on.

8. To create the city form field, perform the following steps:

9. To create the state, perform the following steps:

10. To create the zip form field, perform the following steps:

11. To enter the background text line:

at the bottom of the form (which will serve as the field headings for the subscriptions form), do the following:

The subscribers form is now complete.

12. Now the subscriptions form must be defined. Press the SWITCH key <F7>. The Form Description screen for subscribers is displayed.

13. Press the ADD key <F6>. This readies the Form Description screen for entry of information pertaining to a new form.

14. Fill in the fields of the screen and then store its contents by pressing the STORE key <F5>:

15. A blank development screen is displayed. Since the field headings for this form are on the subscribers form, there is no need to enter any background text on this form.

In the C/Base Tutorial, shaded boxes represent entry fields, underline represents display fields (e.g., lookup fields), and asterisks represent invisible fields (i.e., a field that exists within the form but is not displayed).

On the development screen itself, invisible fields are indicated by blinking under- line characters so that the field may be easily recognized (provided, of course, that your screen has this display capability).

16. The first field, magazine, starts at column 1 of the top line on the screen. Create the form field by moving the cursor to the proper position and then pressing the ADD key <F6>. Enter the following information into the Field Description:

After entering the information, press STORE <F5>. Note the entry of mag in the Validation File field. This indicates that when a magazine code entry is made, the code is validated from the data file mag. Validation of a key field reference value must be done in order for the magazine title to be looked-up and displayed.

17. The field title is a lookup field. When a field’s value is validated against another data file, the contents of any field(s) within that other data file’s record may be displayed on the current form. In this case, the form displays the magazine title found in the data file mag when the magazine code is validated.

To position this field correctly on the screen, press the Tab key three times, then move the cursor to the right two more spaces with the Right Arrow key. Press ADD <F6> and enter the following information:

All of the other fields, including Field Name are left blank. The title field is specified as a lookup field. As a lookup field, there is no Field Name entry, and the Entry Allowed, In Data File, and Input Required fields are all set to no. The length of the field is still indicated, however. When the above information agrees with your entries, press STORE <F5>.

18. Now, position the cursor for creating the started field (by pressing the Tab key five times) and press the ADD key <F6>. When the Field Description screen is displayed enter the following information:

Press STORE <F5>.

19. To position the cursor at the start of the final field on this line, press the Tab key once and then press the Space Bar four times. Next, press the ADD key <F6>, and enter the following information for the issues field.

Press STORE <F5>.

20. The last field of this form, subscriber, is an invisible field. Despite the fact that it is invisible, it must be allotted space on the development screen.

Press the RETURN key to move to the second line directly beneath the magazine field. Then press the ADD key <F6> and enter the following information:

The information in the invisible field is needed so that the subscription information entered can be linked to the appropriate subscriber’s record. It is not necessary to display this information on the screen, since the subscribers form will remain frozen on the screen as the subscription information is entered.

Note that the entry to the Copy from previous field field is set to yes. This means that the subscriber field must appear in both forms. The subscriber code information is passed to the subscriptions form by the Copy from previous field feature. When adding subscriptions into the script file, the subscriber field is automatically set to the same value as in the subscriber form. When finding existing subscriptions, the Copy from previous field feature insures that only subscriptions for the currently displayed subscriber will be retrieved and displayed. STORE <F5> the field entry.

The subscriptions form is now complete. Press the EXIT key <F8>. Toolkit displays the message

The system returns you to the Data Entry Forms Menu after the formfile has been written.