Tinderbox 7 Icon

&= (logical AND assignment)

Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Operator   [other Operator type actions]

 Item   [operators of similar scope]

 Assignment   [other Assignment operators]



To make it easier to write rules succinctly, you can use the assignment:

$TheAttribute &= the_expression; 

…which sets $TheAttribute to the value of the_expression only if it is currently evaluated as true AND the_expression is also evaluates as true. Thus, if $TheAttribute is false, the expression is still evaluated. An attribute that has no value set (or inherited) is evaluated as false.

For most attributes, especially new user attributes, the default value will evaluate as false. But, $TheAttribute's data type does not have to be Boolean.

For new String-type attributes (and string-based Action/Color/File/Font/Interval/List/Set/URL types) the default is an empty string "". For Number-type, is it 0 (zero). For Date-type, it is the string "never". For Boolean-type, is it 'false' (with no quotes, and shown as un-ticked if displayed via a tick-box). The "", 0 and "never" values—for the appropriate data types—evaluate as false. But, be aware that not all system attributes follow this assumption. For instance, the $Color default is preset to use a named Tinderbox colour, so its default value (even if inherited) would evaluate as true .

Prototypes have no direct effect as the outcome, as it initially depends on the evaluation of the left-side attribute value regardless of whether document default, prototype inherited or locally set.

For example, for the Boolean-type attribute $Urgent:

$Urgent &= any(children,$Urgent) 

Thus a project is considered urgent if it has been declared to be urgent itself and if any child is urgent.

See also the logical OR assignment.

in v7.2.2, errors to the function logic were corrected.