$BitOr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
m (misc formatting)
 
Line 2: Line 2:
<span class="pageSubtitle">Bitwise OR of two integers</span>
<span class="pageSubtitle">Bitwise OR of two integers</span>


<p class="warn"><b>Note: </b>Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $BitOr function is the <var>[[BitOrInteger (Float function)|BitOrInteger]]</var> function. There is also an OO <var>[[BitOrString (String function)|BitOrString]]</var> function.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the <var>$BitOr</var> function is the <var>[[BitOrInteger (Float function)|BitOrInteger]]</var> function. There is also an OO <var>[[BitOrString (String function)|BitOrString]]</var> function.</p>


The <var>$BitOr</var> function returns an integer which is the bitwise OR of two integers.  
The <var>$BitOr</var> function returns an integer which is the bitwise OR of two integers.  


<var>$BitOr</var> accepts two arguments and returns a numeric value.
The first and second arguments are both integers. The default values are 0. If either argument is missing, the result defaults to 0. If either argument is invalid, then the argument value defaults to 0.
==Syntax==
==Syntax==
<p class="syntax"><span class="term">%result</span> = <span class="literal">$BitOr</span>(<span class="term">int_1</span>, <span class="term">int_2</span>)
<p class="syntax"><span class="term">%result</span> = <span class="literal">$BitOr</span>(<span class="term">int_1</span>, <span class="term">int_2</span>)
</p>
</p>
<p>
<p>
<var class="term">%result</var> is set to the bitwise OR of the two arguments.</p>
<var class="term">%result</var> is an integer that is set to the bitwise OR of the two <var>$BitOr</var> arguments. If an argument is missing, <var class="term">%result</var> defaults to 0. </p>
<p>
The first and second arguments are both integers, and their default values are 0. If an argument value is invalid, it is treated as a 0. </p>


==Example==
==Example==
Line 33: Line 31:
<li>Japanese functions</li>
<li>Japanese functions</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p>
</p>


[[Category:$Functions|$BitOr]]
[[Category:$Functions|$BitOr]]

Latest revision as of 16:03, 10 January 2018

Bitwise OR of two integers

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $BitOr function is the BitOrInteger function. There is also an OO BitOrString function.

The $BitOr function returns an integer which is the bitwise OR of two integers.

Syntax

%result = $BitOr(int_1, int_2)

%result is an integer that is set to the bitwise OR of the two $BitOr arguments. If an argument is missing, %result defaults to 0.

The first and second arguments are both integers, and their default values are 0. If an argument value is invalid, it is treated as a 0.

Example

The following program will print the value 7:

B Print $BitOr(6, 3) End

Products authorizing $BitOr