or

Summary

Evaluates all parameters until one is found to be true, returns that value.

Usage

or( value [,...] )

Parameters

NameTypeDescriptionRequired
value mixed To be evaluated. Yes.
...

Returns

Boolean.

Description

Evaluates all parameter values until one is found to be true, then returns that value. The remaining parameters are not evaluated at all. If there are no parameters or all elements were false, the operator returns false.

Evaluation is done the following way:
If input value is array, it will be evaluated as true if it has one or more elements
If input value is numeric, it will be evaluated as true if value is non-zero
If input value is NULL, it will be evaluated as false
If input value is an object, it will be evaulated as true if the object have the methods "attributes" and "attribute"
Other types will be evaluated in the same matter as PHP would do

Examples

{or( false(), false(), true(), false() )}

returns true.

Comments

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
    Data extraction
    Formatting
    Images
    Logic
       and
       choose
       cond
       eq
       false
       first_set
       ge
       gt
       le
       lt
       ne
       not
       null
       or
       true
    Mathematics
    Miscellaneous
    Strings
    URLs
    Variables
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
11:43:51 am
by Balazs Halasy

Last updated

13/02/2004
5:17:10 pm
by Derick Rethans

Authors

Balazs Halasy
Derick Rethans



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.