BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy


   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo FML Function Reference

Fnext, Fnext32(3fml)


Fnext(), Fnext32() - get next field occurrence


#include <stdio.h> 
#include "fml.h"

Fnext(FBFR *fbfr, FLDID *fieldid, FLDOCC *oc, char *value, FLDLEN *len)

#include "fml32.h"

Fnext32(FBFR32 *fbfr, FLDID32 *fieldid, FLDOCC32 *oc, char *value, FLDLEN32 *len)


Fnext() finds the next field in the buffer after the specified field occurrence. fbfr is a pointer to a fielded buffer. fieldid is a pointer to a field identifier. oc is a pointer to the occurrence number of the field. value is a pointer to the value of the next field. len is the length of the next value.

The field identifier, FIRSTFLDID, should be specified to get the first field in the buffer (for example, on the first call to Fnext()). If value is not NULL, the next field value is copied into value; *len is used to determine if the buffer has enough space allocated to contain the value. The value's length is returned in *len. If len is NULL when the function is called, it is assumed that there is enough space and the new value length is not returned. If value is NULL, the value is not retrieved and only fieldid and oc are updated. The *fieldid and *oc parameters are respectively set to the next found field and occurrence. If no more fields are found, 0 is returned (end of buffer) and *fieldid, *oc, and *value are left unchanged. Fields are returned in field identifier order.

Although the type of value is char *, the value returned will be of the same type as the next field being retrieved.

When the type of the field to be retrieved is FLD_VIEW32, the value parameter points to a FVIEWFLD structure. The Fnext() function populates the vname and data fields in the structure.

Fnext32() is used with 32-bit FML.

A thread in a multithreaded application may issue a call to Fnext() or Fnext32() while running in any context state, including TPINVALIDCONTEXT.

Return Values

Fnext() returns 1 when the next occurrence is successfully found. It returns 0 when the end of the buffer is reached.

This function returns -1 on error and sets Ferror to indicate the error condition.


Under the following conditions, Fnext() fails and sets Ferror to:


"fielded buffer not aligned"
The buffer does not begin on the proper boundary.


"buffer not fielded"
The buffer is not a fielded buffer or has not been initialized by Finit().


"no space"
The size of value, as specified in len, is not large enough to hold the field value.


"invalid argument to function"
One of the arguments to the function invoked was invalid (for example, specifying NULL for fieldid or oc).

See Also

Introduction to FML Functions, Fget, Fget32(3fml), Fnum, Fnum32(3fml)