Translating Field Identifiers

There is a family of functions that provide a means of translating from one field identifier to another. The known identifier is specified as a parameter, and the desired identifier is returned. These functions are listed in Table 22.2 and are described in more detail in Chapter 34, "Getting and Updating Data in the Form."

Table 22.2: Functions to Translate Field Identifiers

Type Function Name Translation
int (name_stp, fmp) Name to number
PTR (name_stp, fmp) Name to pointer
UCHAR * (item_num, fmp) Number to name
PTR (item_num, fmp) Number to pointer
UCHAR * (itemp) Pointer to name
int (itemp, fmp) Pointer to number

Functions that take or return an item number use the processing order of the fields to determine the item number. Numbering starts at 0. Thus, the first field (in processing order) has an item number of 0, the second field has an item number of 1, and so on.

Caution: For functions that return pointers, you must cast the returned pointer to the appropriate type. The appropriate type for a menu field is MFIELDPTR.


Home Contents Previous Next