and: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page and to And without leaving a redirect: Converting page title to first-letter uppercase)
m (Text replacement - "<source" to "<syntaxhighlight")
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
and(n1, n2, ...)
and(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: and(1,1)]
[r: and(1,1)]
[r: and(1,1,0)]
[r: and(1,1,0)]
</source>
</syntaxhighlight>
'''Returns:'''
'''Returns:'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
1
1
0
0
</source>
</syntaxhighlight>


|also=
|also=

Latest revision as of 17:29, 14 March 2023

and() Function

This function performs a logical AND comparison between all of the passed numeric values. A value of 0 is false and all non-zero values are treated as true

Usage

and(n1, n2, ...)

Parameters

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

Example

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

Returns:

1
0

See Also