Using VPLUS: An Introduction to Forms Design (32209-90004)

7-19
display-only.
TOPIC: CHANGE FORM SEQUENCE PROGRAMMATICALLY
The basic control of forms sequence is established on the Form Menu. For
example, the repeating form ORDER_LINE is defined on its Form Menu as a
repeating appended form by the A in the Repeat Option selection box; and
the frozen first form ORDER_HEAD is so defined by an F in the Next Form
selection box. A CHANGE statement is provided by FORMSPEC that allows
you to change these specifications during execution of the forms file.
CHANGE Statement
The CHANGE statement allows you to change form specifications as fol-
lows:
The current form can be changed to: NOREPEAT
REPEAT
REPEAT APPEND
The next form option can be changed to: CLEAR
APPEND
FREEZE APPEND
and the next form name can be changed to: "form name"
field name (field
contains a form name)
index retrieve (select
from form names)
$RETURN
$HEAD
$END
$REFRESH
Usually, the CHANGE statement is used in conjunction with an IF state-
ment
so that the form option or next form name is changed only under specified
circumstances.
At this point in the exercise, there is no limit to the number of times
the repeating form ORDER_LINE is issued. If the form is appended so many
times that it fills the screen, the first ORDER_LINE is rolled off the
screen, leaving ORDER_HEAD frozen on the screen above the second
ORDER_LINE. This continues until the user presses NEXT FORM in ENTRY to
stop the repeat and display the next different form.
Now let's use the CHANGE statement to stop the repeat automatically when
the screen is full. In other words, in the exercise, you will use the
CHANGE statement to change the current form to NOREPEAT after it has been
repeated a specified number of times. This forces the repeat to
terminate and the next different form to be displayed even if the user
does not press NEXT FORM in ENTRY. As another example, you will also use