Skip to content

andbool()

andbool([<boolean1>[, ... <booleanN>]])
orbool([<boolean1>[, ... <booleanN>]])
candbool([<boolean1>[, ... <booleanN>]])
corbool([<boolean1>[, ... <booleanN>]])

andbool() returns 1 when every argument is true, and orbool() returns 1 when at least one is. candbool() and corbool() do the same, but evaluate their arguments one at a time and stop as soon as the answer is known, so later arguments may never run.

These read each argument as TinyMUX reads a boolean, whatever the tiny_booleans and mux_logic @config options say. False is an empty or blank string, a number equal to zero, NaN, Inf or Ind, and anything starting with #-. Everything else is true, including negative numbers, dbrefs and words. With no arguments, andbool() and candbool() are 1, and orbool() and corbool() are 0. An argument that evaluates to nothing is false.

These functions come from TinyMUX.

> think andbool(1, abc, #5, -3)
1

Output: every argument is true, the word and the negative number included.

> think orbool(0, #-1 NO MATCH, 0.000)
0

::: seealso