The user has two ways of leaving a form: exiting or quitting. If he chooses to quit from the form, Vermont Views does not save the data that he has typed into the underlying data variables for the fields. (There are a few exceptions to this, which will be discussed later in this section.) If he chooses to exit from the form, Vermont Views saves the information that the user has typed into the underlying data variables.
If you are writing a modal application, you can determine whether the user exited or quit by checking the return value from the function that processed the form (fm_proc() or fm_rd()). If you are writing a non-modal application, you will need to find an alternate method of performing this task. See Chapter 30, "Differences in Non-Modal Form Processing," for more information on non-modal programming and for suggestions on how to handle this situation.
If the user exited the form, Vermont Views converts the information typed by the user and stores it into the underlying data variables for each field. To get access to this information after the user has exited the form, you should use the underlying data variables.
If the user quit the form, he did not intend to save the data that he typed. The idea of quitting implies that the user cancelled what he did, and your data variables have not been changed from their initial values. If the user quits, Vermont Views does not update the underlying data variables, and you have no access to the information that he or she typed. In most cases, you can count on the underlying data variables having the same information in them as they had when the form was first displayed.
However, there are two conditions which may cause the underlying data variables to be updated even if the user quits the form. First, if you turn the FORCECONVERT option ON for a data field, the underlying data variable is updated as soon as the user leaves that field. Second, if the user scrolls a scrollable region, the rows that are scrolled off the screen are converted, and the values are stored in the underlying data structure for the scrollable region. If the user quits from the form, Vermont Views cannot restore the original values of these underlying data variables. If you are using the FORCECONVERT option, or if you have a scrollable region on the form, you should assume that your underlying data variables have been altered, and that they may not be in a consistent state.