L3DT users' wiki
Large 3D terrain generator

or

Description

The boolean 'or' function returns true if either of its two boolean arguments are true.

Function prototype

bool or <bool:arg1> <bool:arg2>

Arguments

Name Type Comment
arg1 bool The first boolean argument to be tested.
arg2 bool The second boolean argument to be tested.

Return value

True if either arg1 or arg2 are true, and false if neither are true.

Example

// create two new boolean variables...
bool b1
bool b2

// ...and set one to true and one to false
set b1 true
set b2 false

// call 'or b1 b2', and pipe result to event log via echo
echo <zs:or b1 b2>

… the output of which is written to the event log by echo as:

true

Comments

Both arguments are evaluated

Unlike other languages such as C/C++, both arguments to the or function are always evaluated in ZeoScript, regardless of whether the answer can be determined from the first argument alone.

See also

 
plugins/general/zeoscript/reference/functions/or.txt · Last modified: 2017/08/31 05:47 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki