or: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Or to or: Converting page titles to lowercase)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
or(n1, n2, ...)
or(n1, n2, ...)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|n1|Number}}
{{param|n1|Number}}
Line 16: Line 16:


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: or(1,1)]
[r: or(1,1)]
[r: or(0,0)]
[r: or(0,0)]
[r: or(1,1,0)]
[r: or(1,1,0)]
</source>
</syntaxhighlight>
'''Returns:'''
'''Returns:'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
1
1
0
0
1
1
</source>
</syntaxhighlight>


|also=
|also=

Latest revision as of 23:59, 14 March 2023

or() Function

This function performs a logical OR comparison between all of the passed numeric values. A value of 0 is false and all non-zero values are treated as true. As long as one passed in value is true, the result will be true.

Usage

or(n1, n2, ...)

Parameters

  • n1 - Number
  • n2 - Number
  • n3+ - Number

Example

[r: or(1,1)]
[r: or(0,0)]
[r: or(1,1,0)]

Returns:

1
0
1

See Also