5.6 Entering the Actual Form

After you store a new form description with the STORE <F5> key, formdef clears the screen and allows you to enter the form itself. Alternately, if you are modifying an old formfile, the form can be displayed by first finding its form description using the PREVIOUS <F2> and NEXT <F3> keys on the Form Description screen. After the form description has been located, push the SWITCH <F7> key. The form corresponding to that form description is then displayed.

You can move the cursor anywhere on the screen when entering the actual form. You are free to move the cursor about and enter background text as titles for the form and the different fields anywhere on the screen. The last two lines of the screen are reserved for messages from form, so no background text or fields may be entered there.

Form uses features of the monitor, such as reverse video and underlined fields, to draw data fields on the screen. Many monitors require a space on the screen to start or finish a field that uses reverse video or underlined fields. Formdef enforces this requirement. It is not possible to place two fields immediately next to one another, nor is it possible to place text immediately in front of or behind a data field. Also, one space is reserved at the beginning of each line and at the end of each line in case space is needed for a display enhancement character. Thus, for most monitors, there are only 78 usable characters across the screen for creating forms.

Some monitors do not require a space to start or stop display enhancements. When the formfile will only be used with these monitors, you can invoke formdef with the -c flag, as in:

c:\> formdef -c formfile

Keep in mind that when using the -c flag, a form can be created that cannot be displayed properly on certain monitors. The -c flag should be used only when these special monitors are the only monitors that will be used.

You can use the Arrow keys to position the cursor anywhere on the screen. The Arrow keys do not go past margins. For example, pushing the Up Arrow key when on the first line has no effect. The Tab key moves the cursor to the next tab stop. Tab stops are set every eight spaces. The RETURN key positions the cursor to the first character of the next line down.

You can move the cursor to any position on the screen and type background text. Form shows the background text along with the data entry fields when the form is displayed. For example, you could type background text as a title at the top of the screen; each data entry field may also be given a title. Adding data entry fields themselves is explained in the next section.

The function keys can also be used here. They have the same names as they did for the Form Description screen:

F1 GOLD

F2 PREVIOUS

F3 NEXT

F4 UPDATE

F5 STORE

F6 ADD

F7 SWITCH

F8 EXIT

The PREVIOUS <F2> key displays the form before the current form that is stored in the formfile. If there are no forms before the current form, formdef displays the "No more forms" error message. If you press the PREVIOUS <F2> key again, formdef displays the last form in the formfile.

The NEXT <F3> key displays the form after the current form as stored in the formfile. If there are no forms after the current form, formdef displays the "No more forms" error message. If you press the NEXT <F3> key again, formdef displays the first form in the formfile.

Pressing the ADD <F6> key adds a data entry field into the current form at the current cursor location. Form displays a Field Description form and you can enter data about the new data entry field. After the Field Description form is completed, pushing STORE <F5> redisplays the data entry form being built with the new field added to the screen.

To modify an existing field, move the cursor into the field and press the UPDATE <F4> key. The cursor can be positioned anywhere within the field to be modified. After the field description has been modified, push the STORE <F5> key to return to the form being built. If the UPDATE <F4> key is pushed while updating a Field Description, the original contents of the Field Description form is redisplayed.

If the SWITCH <F7> key is pressed, the screen is erased, and the Form Description screen for the current form is displayed. Pressing SWITCH <F7> again returns you to the form being built.

Pushing EXIT <F8> causes all the forms to be written to the formfile and formdef to exit.

To delete a field from the form, position the cursor in the field and press the GOLD <F1> key and then the D key. Formdef saves a copy of the last screen field that was deleted. You can restore this screen field to the screen by pushing the GOLD <F1> key and then the U (for undelete) key. By using combinations of GOLD <F1> D, moving the cursor, and typing GOLD <F1> U, screen fields can be easily moved about on the screen.

If the keyboard has Insert Line and Delete Line keys, these can be used to add or delete lines in the form. The Delete Line key will not delete a line that contains any data fields in it. Data fields must be deleted one at a time by placing the cursor on the data field and pressing the GOLD <F1> key and then the D key. Pushing the Insert Line key adds a blank line at the current cursor position and deletes the last line of the form. If there are any data fields in the last line, however, no line is inserted. The data fields on the last line must be deleted first before an Insert Line can be done.

If the keyboard has Insert Character and Delete Character keys, these can be used to add and delete characters on the form. Pushing the Insert Character key inserts a space at the current cursor position and shifts the rest of the line to the right (including any data fields). Data fields cannot be shifted off the end of a line, but background text can. Pushing the Delete Character key deletes the character at the current cursor position and shift the rest of the line left (including any data fields). The Delete Character key cannot be used if the cursor is on (or, without the -c flag, adjacent to) a data field.