11. Report-Writer Expressions and Formats : Operations : Boolean Functions
 
Share this page                  
Boolean Functions
A Boolean function is like a built-in function except that it returns a value of true or false instead of number, string, or date. The result of a Boolean function cannot be printed; it can only be used as a condition. A Boolean function is composed of a function name followed by an operand in parentheses.
The break function is the only Boolean function found in Report-Writer. For more information, see Breaks in the chapter "Using Report-Writer." Its syntax is:
break (columnname)
The columnname parameter must either be a break column (that is, it must be in the sort list) or the value report.
If you specify a break column, Report-Writer returns a value of true if the current value for that column has changed from the previous value or if the current value in any column of higher precedence than column has changed. If neither the current value for column nor the current value of any column of higher precedence in the sort list has changed, it returns a value of false. If report is specified, it returns true if the end of the report is reached; otherwise, it returns false.
The following example illustrates the use of Boolean functions:
.sort dept, empno
      /* Other Report Writer statements */
.footer empno
      .if not break(dept) .then
          .newpage
      .endif
This generates a new page when the employee number breaks, but only if no break occurs on the department.