The user can page from one form to another if you link forms together. When the user presses the Next Form key (assigned to Shift-F8, by default) the next form in the list is displayed. To get back to the previous form, the user presses the Previous Form key (assigned to Shift-F7, by default).
Designer: You can specify page links using the Designer. See the Designer User's Guide for details.
You are responsible for getting all of the linked forms from the Designer library yourself. If you have specified page links inside the Designer, you can use the Main Generator to generate the code to read and link the forms.
If you do not use the Main Generator and you have specified page links inside the Designer, you can use Vermont Views functions to determine what forms need to be read from the library. To get the name of the next or previous form, use fm_nextfmname() or fm_prevfmname():
|
These functions return a pointer to a form name, or NULLP if no previous form was specified in the Designer.
Caution: fm_nextfmname() and fm_prevfmname() work only for page links established in the Designer. They will not work for forms that were linked by calling sfm_link().
To determine whether the next or previous form has already been read from the Designer library, use the form name to pointer function fm_namptr():
|
fm_namptr() returns a pointer to the form with the specified name if that form is currently in memory. It returns NULLP if no form with the specified name is found.
You can also specify page links in your code, as described below, at any time after reading the forms from the Designer library.
Code: To create a page link, all forms must first be defined. The list of forms is created in code by calling the set form page link function, sfm_link():
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Specify NULLP for next_dfmp or prev_dfmp if you do not want to specify a next or previous form.
Note: If you specify page links in the Designer, you do not need to call sfm_link() in your code. Vermont Views will automatically link the forms during processing.
The following code example shows how to create a paging list for 5 forms:
|
You can make the list circular by specifying dfmp_5 as the previous form for form dfmp_1 and specifying dfmp_1 as the next form for form dfmp_5.