Cicode Programming Reference > Cicode Function Categories > Form Functions Introduction > FormSetInst

FormSetInst

Associates an integer and string value with each field on a form. This data could then be used by a callback function. You can use a single callback function for all fields, and use the data to perform different operations for each field.

Syntax

FormSetInst(hForm, hField, iData, sData)

hForm:

The form handle, returned from the FormNew() function. The form handle identifies the table where all data on the associated form is stored.

hField:

The field handle of the field currently selected.

iData:

Integer data.

sData:

String data.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

FormGetInst

Example

! Open recipe database.
hDev=DevOpen("Recipe", 0);
hForm=FormNew("Recipe",20,5,0);
hField=FormButton(5,2,"Next",GetNextRec,0);
FormSetInst(hForm,hField,hDev,"");
/* The device handle hDev is put into the next button , so when the button is selected it can get hDev and get the next record. */

See Also

Form Functions