LOG IN SIGN UP
Documentation

BOOL

A boolean type. Values are true and false. For example:

1
set beresp.cacheable = true;

Integer literals may not be used to assign to a BOOL variable. Likewise there is no implicit conversion to INTEGER types:

1
2
3
4
5
declare local var.i INTEGER;
declare local var.b BOOL;
set var.b = true;
set var.i = 0;
set var.i += var.b; /* invalid */

Nor may STRING literals be used for assignment (i.e. "true" rather than true), however BOOL values may be converted to a STRING, and are rendered as "1" and "0" for true and false respectively:

1
2
3
declare local var.b BOOL;
set var.b = true;
log var.b; /* equivalent to "1" */

Back to Top