suve

awful: function: and

Declaration

bool :and ( bool $ARG , … )
bool :&& ( bool $ARG , … )

Summary

Takes any number of arguments and performs a boolean AND operation on them. Arguments which are not booleans will be cast silently.

Example

# Check if number is 40-something.
:set &NUM i0
:read &NUM
!if :and (:ge $NUM i40) :lt $NUM i50
    :writeln s'Yay, number is >= 40 and <50.'
    !fi

Note that !if performs a logical AND between arguments automatically - so, strictly speaking, the :and call is completely unnecessary.

wikipage modified on 2014/0601/2316