The Virtual Forms Input Data Object
The input data object (VDATA) is composed of various sub-objects (i.e. "data items") that correspond to the fields of the input template. Each data item contains an object whose class is specified by a field's "class" keyword (e.g. class = ).
If a field is flagged as a list (e.g. list = yes),
the data item consists of a list of objects of the specified class. If
"list=yes" is not included in a FIELD definition,
it is assumed the field is used to gather a single element of data.
The C language function assigned to "function = "
should have the following type and arguments:
|
int YourFunction
(
int idx_in, /* i: index of input data-object (class=VDATA) */
int *idx_out /* o: index of output data-object (class=VDATA) */
)
{
...
return(0 or 1); |
The function should return 1 if it fails or 0 if it succeeds.
It is critical that the function return the proper value. A return value of 1 tells the Input Manager to automatically "undo" any modifications made by "YourFunction()" to the object database or the graphic display.
"Idx_in" is a handle to an object that contains the input data (VDATA) gathered by the Input Manager according the template associated with "YourFunction()".
"YourFunction()" may use the "VxInp***" functions to query "idx_in" for the various data items stored in the object referenced by "idx_in". Each data item is identified by a template field id. See functions in the VxIn library for more details on these.
"YourFunction()" can ignore "*idx_out."