Produces the value false, or tests for the false value against zero or more given values.
<false>
— expresses the value false
<false 1,0,null,{false},false>
— tests the values in the primary field and produces
the resulting values: false,false,false,false,true
.
Although three of the values in the primary field would logically evaluate to false, only the last one is the value false itself.
Optional. The primary field may contain one or more values to test against.
The false tag, when used without any field values, may be used to express the literal value false
anywhere it is required.
When at least one primary field value is specified, the tag functions in a different way: it tests values for being exactly the value false.
This is different from using the eq tag to check if a value is 'equal' to false.
Many values such as 0, null, or {}
are evaluated as being equal to false, but the false tag tests for
an exact match to the value false itself.
In the following code, both the eq and false tags are used to compare a vector containing various values.
<v:vector 52.5,null,false,true> - values are: <join delim={,} v></n> - eq tag produces: <join delim={,} <i:for 1 limit=v.# do= <eq false, <v.@ i>> > ></n> - false tag produces: <join delim={,} | false v></n>
Although the false tag accepts multiple values and can produce a list of results, the eq tag only produces a single result of comparison, hence a for tag is used to test against each value. In both cases, the join tag is used to separate the values with commas so the list of values doesn't run together when pushed into the console.
The following appears in the console. The eq tag is used to test if each of the values logically and arithmetically equates to false even if they are different types, but the false tag imposes a stronger condition, requiring them to be of the same type.
- values are: 52.5,,false,true - eq tag produces: false,true,true,false - false tag produces: false,false,true,falseIn this case the expression <eq false, null>
evaluates to true, but the expression
<false null>
evaluates to false, hence the difference in output.