abfRequested()
Indicates whether a particular component was requested by the program.
Syntax
intabfRequested(int type, int req, int comp);
Inputs
- type
- The index of the datatype.
- req
- The index of the request.
- comp
- The index of the component.
Return Value
- 0
- Component is not requested
- 1
- Component is requested
Example
if (abfRequested(type, req, comp)
abfOpenDatatypeByIndex(type);
abfOpenRequestByIndex(type);
abfOpenComponentByIndex(type);
/* read data into double *data */
abfAddReals(data, numvals);
abfCloseComponent();
abfCloseRequest();
abfCloseDatatype();
}
Comments
To use this call, you must create all the datatypes, requests, and components which you would use if you were producing a complete file. But you do not have to fill in the values for the components not requested.
This approach only works if the translator was invoked by the program. In a standalone setting, this call always returns a one.
If comp is -1, then the function returns 1 if any component was requested. If req is -1, the function returns 1 if any combination of requests and components were requested.