Fboolev, Fboolev32, Fvboolev, Fvboolev32 - evaluate buffer against tree #include <stdio.h> #include "fml.h" int Fboolev(FBFR *fbfr, char *tree) int Fvboolev(char *cstruct, char *tree, char *viewname) #include "fml32.h" int Fboolev32(FBFR32 *fbfr, char *tree) int Fvboolev32(char *cstruct, char *tree, char *viewname)
Fboolev() takes a pointer to a fielded buffer, fbfr, and a pointer to the evaluation tree returned from Fboolco(), tree, and returns true (1) if the fielded buffer matches the specified Boolean conditions and false (0) if it does not. This function does not change either the fielded buffer or evaluation tree. The evaluation tree is one previously compiled by Fboolco(3fml).
Fboolev32 is used with 32-bit FML.
Fvboolev and Fvboolev32 provide the same functionality for views. The viewname parameter indicates the view from which the field offsets are taken, and should be the same view specified for Fvboolco or Fvboolco32.
These functions are not supported on /WS platforms.
Fboolev() returns 1 if the expression in the buffer matches the evaluation tree. It returns 0 if the expression fails to match the evaluation tree. This function returns -1 on error and sets Ferror to indicate the error condition.
Under the following conditions, Fboolev() fails and sets Ferror to:
Using the evaluation tree compiled in the example for Fboolco(3fml):
#include <stdio.h> #include "fml.h" #include "fld.tbl.h" FBFR *fbfr; Fchg(fbfr,FIRSTNAME,0,"John",0); Fchg(fbfr,SEX,0,"M",0); if(Fboolev(fbfr,tree) > 0) fprintf(stderr,"Buffer selected"); else fprintf(stderr,"Buffer not selected");
would print "Buffer selected".