Fvals, Fvals32 - return string value of field occurrence
#include <stdio.h> #include "fml.h" char * Fvals(FBFR *fbfr, FLDID fieldid, FLDOCC oc) #include "fml32.h" char * Fvals32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc)
Fvals() works like Ffind(3fml) for string values but guarantees that a value is returned. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field.
If the specified field occurrence is not found, then the null string is returned. This function is useful for passing the value of a field to another function without checking the return value. This function is valid only for fields of type FLD_STRING; the null string is automatically returned for other field types (that is, no conversion is done).
Fvals32 is used with 32-bit FML.
This function returns the null string on error and sets Ferror to indicate the error condition.
Under the following conditions, Fvals() fails and sets Ferror to: