Installing a User Pointer in a Field or Form

The user pointer is of type long. It can contain a numeric value, or point to any type of variable or structure. Install a user pointer to a data object in a form, data field or memo field with the user pointer set function, :

userp_set(datap, itemp)

long datap;

PTR itemp;

For example, you can place a pointer to an integer in a data field with:

DFIELDPTR fldp;            /* Pointer to a data field            */

int maxval = 100;

fldp = fld_def(0, 0, NULLP, 0, "999", F_INT, (PTR) &data, dfmp);

userp_set(&maxval, fldp);

You should be sure that the variable pointed to by the user pointer is available for use when you access this value.


Home Contents Previous Next