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:
a. Enter the text for the first field heading by positioning the cursor at column 1 of line 3 and typing Subscriber.
b. To create the form field, move the cursor to the starting position of the field (by pressing the Tab key once and the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. After you have entered the information, store the description by pressing the STORE key <F5>.
6. To create the name form field perform the following steps:
a. Enter the text for this field heading by positioning the cursor at column 1 of line 5 and typing Name.
b. To create the form field, move the cursor to the starting position of the field (by pressing the Tab key twice and the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. After you have entered the information, store the description by pressing the STORE key <F5>.
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.
a. Enter the text for this field heading by positioning the cursor at column 1 of line 7 and typing Address.
b. To create the form field for the first element of the array, move the cursor to the starting position of the field (by pressing the Tab key once and the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. After you have entered the information, store the description by pressing the STORE key <F5>.
e. Move the cursor directly below the address[1] field by using the Down Arrow key.
f. Press the ADD key <F6> and enter the information pertaining to the second element of the array:
g. Store the contents of the screen by pressing the STORE key <F5>.
8. To create the city form field, perform the following steps:
a. Enter the text for this field heading by positioning the cursor at column 1 of line 10 and typing City.
b. To create the form field, move the cursor to the starting position of the field (by pressing the Tab key twice and the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. After you have entered the information, store the description by pressing the STORE key <F5>.
9. To create the state, perform the following steps:
a. Enter the text for this field heading by positioning the cursor at column 1 of line 12 and typing State.
b. To create the form field, move the cursor to the starting position of the field (by again pressing the Tab key twice and the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. After you have entered the information, store the description by pressing the STORE key <F5>.
10. To create the zip form field, perform the following steps:
a. Enter the text for this field heading by moving the cursor to column 37 of line 12 (press the Tab key two times, the Space Bar five times) and type Zip.
b. To create the form field, move the cursor to the starting position of the field (press the Space Bar five times) and press the ADD key <F6>.
c. Enter the information in the Field Description screen.
d. With the entry of this fields information completed, store the description by pressing the STORE key <F5>.
11. To enter the background text line:
Magazine - Title - Started - Left
at the bottom of the form (which will serve as the field headings for the subscriptions form), do the following:
a. Press RETURN twice and the Space Bar once to position the cursor at column 1 of line 14.
b. Type Magazine and press the Tab key once and the Space Bar five times.
c. Type Title and press the Tab key four times and the Space Bar three times.
d. Type Started and press the Tab key once.
e. Type Left.
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:
Field Name - magazine
Field Length - 15
Entry Allowed - yes
Input Required - yes
In Data File - yes
Invisible - no
Validation File - mag
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 fields value is validated against another data file, the contents of any field(s) within that other data files 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:
Field Name - (blank)
Field Length - 35
Entry Allowed - no
Input Required - no
In Data File - no
Invisible - no
Lookup Field - title
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:
Field Name - started
Field Length - 10
Entry Allowed - yes
Input Required - yes
In Data File - yes
Invisible - no
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.
Field Name - issues
Field Length - 5
Entry Allowed - no
Input Required - no
In Data File - no
Invisible - no
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:
Field Name - subscriber
Field Length - 15
Entry Allowed - no
Input Required - no
In Data File - yes
Invisible - yes
Copy from previous field - yes
The information in the invisible field is needed so that the subscription information entered can be linked to the appropriate subscribers 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
Adding logical form file subscrpt to form database...
Catalog entry for logical form file demo.smj~subscrpt added.
Push RETURN to return to menu....
The system returns you to the Data Entry Forms Menu after the formfile has been written.