Resolving External References for a Data Form

To assign a data structure to a form for storage of collected data, use the set form data structure function, sfm_datap()

void sfm_datap(datastructp, dfmp)

PTR datastructp;        /* Pointer to data structure for form    */

DFORMPTR dfmp;        /* Pointer to form to resolve            */

Note that you must include the header file containing the structure for the data storage for the form in the module where you call sfm_datap().

To resolve the functions called by a form, use the set form function list function, sfm_funclist():

int sfm_funclist(funclistp, fmp)

FUNCLISTPTR funclistp;            /* Pointer to function list        */

FORMPTR fmp;                /* Pointer to form to resolve     */

To assign a choice list memory file to a form, use the set form memory file choice list function, sfm_mfclist():

int sfm_mfclist(mfp, dfmp)

MFILEPTR mfp;    /* Pointer to memory file holding            */

                /* choice list for form                    */

DFORMPTR dfmp;    /* Pointer to data form to resolve            */

                /* choice list memory file pointer            */

Generally, you would use sfm_mfclist() in situations where you do not want to define the memory file before reading the form from the Designer library. For example, you may be building the choice list dynamically, based on data that the user has entered in previous forms.

Thus, the dl_fmget() call below:

DFORMPTR dfmp;

DLIBPTR libp;

FUNCLISTPTR des_lib;

DES_FORM des_data;

MFILEPTR choice_mfp;

choice_mfp = mf_def(200, 76);

dfmp = dl_fmget("des_form", &des_data, des_lib, choice_mfp, libp);

can be replaced with the following calls:

dfmp = dl_fmget("des_form", NULLP, NULLP, NULLP, libp);

sfm_datap(des_datap, dfmp);

sfm_funclistp(des_lib, dfmp);

sfm_mfclist(choice_mfp, dfmp);

More:

Resolving or Overriding the Data Reference for One Field

Resolving or Overriding the Data References for a Scrollable Region

Resolving or Overriding the Choice List Memory File for One Field


Home Contents Previous Next