Fboolco, Fboolco32, Fvboolco, Fvboolco32 - compile expression, return evaluation tree
#include <stdio.h> #include "fml.h" char * Fboolco(char *expression) char * Fvboolco(char *expression, char *viewname) #include "fml32.h" char * Fboolco32(char *expression) char * Fvboolco32(char *expression, char *viewname)
Fboolco() compiles a Boolean expression, pointed to by expression, and returns a pointer to the evaluation tree. The expressions recognized are close to the expressions recognized in C. A description of the grammar can be found in the FML Programmer's Guide.
The evaluation tree produced by Fboolco() is used by the other boolean functions listed under SEE ALSO; this avoids having to re-compile the expression.
Fboolco32 is used with 32-bit FML.
Fvboolco and Fvboolco32 provide the same functionality for views. The viewname parameter indicates the view from which the field offsets are taken.
These functions are not supported on /WS platforms.
This function returns NULL on error and sets Ferror to indicate the error condition.
Under the following conditions, Fboolco() fails and sets Ferror to:
#include "stdio.h" #include "fml.h" extern char *Fboolco(); char *tree; if((tree=Fboolco("FIRSTNAME %% 'J.*n' && SEX = 'M'")) == NULL) F_error("pgm_name");
compiles a boolean expression that checks if the FIRSTNAME field is in the buffer, begins with 'J' and ends with 'n' (for example, John, Jean, Jurgen, etc.) and the SEX field equal to 'M'.
The first and second characters of the tree array form the least significant byte and the most significant byte, respectively, of an unsigned 16 bit quantity that gives the length, in bytes, of the entire array. This value is useful for copying or otherwise manipulating the array.