$StrOr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$StrOr}} <span class="pageSubtitle"><section begin="desc" />Bit-wise OR two strings<section end="desc" /></span> <p class="warning">Most Sirius $functions have be...")
 
(Automatically generated page update)
 
(44 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$StrOr}}
{{DISPLAYTITLE:$StrOr}}
<span class="pageSubtitle"><section begin="desc" />Bit-wise OR two strings<section end="desc" /></span>
<span class="pageSubtitle">Bit-wise OR two strings</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $StrOr function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $StrOr function is the [[BitOrString (String function)]].</p>


This function performs a bit-wise OR of two strings.  
This function performs a bit-wise OR of two strings.  


The $StrOr function accepts three arguments and returns a string result that is the bit-wise OR of the first two arguments, the shorter being padded with as many copies of the third argument as are required to make the string lengths equal.  
The <var>$StrOr</var> function accepts three arguments and returns a string result that is the bit-wise OR of the first two arguments, the shorter being padded with as many copies of the third argument as are required to make the string lengths equal.  


The first argument is an arbitrary string.  
==Syntax==
<p class="syntax"><span class="term">%STR</span> = <span class="literal">$StrOr</span>(<span class="term">string1</span>, <span class="term">string2</span>, [<span class="term">pad</span>])
</p>
 
===Syntax terms===
<table>
<tr><th>%str</th>
<td>The bit-wise AND of <var class="term">string1</var> and <var class="term">string2</var>.</td></tr>
 
<tr><th>string1</th>
<td>An arbitrary string.</td></tr>


The second argument is another arbitrary string.  
<tr><th>string2</th>
<td>Another arbitrary string.</td></tr>


The third argument is another arbitrary string that is appended to the shorter of the first two strings and replicated as many times as required to make the strings of equal length. If this value is not specified or is null it defaults to a single null byte (X'00').
<tr><th>pad</th>
==Syntax==
<td>An arbitrary string that is appended to the shorter of the first two strings and replicated as many times as required to make the strings of equal length. If this value is not specified or is null, it defaults to a single null byte (X'00').
<p class="syntax"><section begin="syntax" /> %STR = $StrOr(string1, string2, pad)
</td></tr>
<section end="syntax" /></p>
</table>
<p class="caption">$StrOr Function
 
==Examples==
<ol>
<li>This code fragment would set <code>%junk</code> to <code>X'756333445566'</code>:
<p class="code">%X = $X2C('112233445566')
%Y = $X2C('654321')
%junk = $StrOr(%X, %Y)
</p>
</p>
<p class="caption">%STR is the bit-wise OR of '''string1''' and '''string2'''.</p>
 
For example
<li>These statements would set <code>%junk</code> to <code>X'DDEEFFCCDDEE'</code>:
<p class="code"> %X = $X2C('112233445566')
<p class="code">%X = $X2C('112233445566')
%Y = $X2C('654321')
%junk = $StrOr(%X, , $X2C('CC'))
%JUNK = $StrOr(%X, %Y)
</p>
</p>
would set %JUNK to X'756333445566' and
 
<p class="code"> %X = $X2C('112233445566')
<li>This code fragment would set <code>%junk</code> to <code>X'1122FF44FF66'</code>:
%JUNK = $StrOr(%X, , $X2C('CC'))
<p class="code">%X = $X2C('112233445566')
</p>
%Y = $X2C('1122')
would set %JUNK to X'DDEEFFCCDDEE' and
%Z = $X2C('FF00')
<p class="code"> %X = $X2C('112233445566')
%junk = $StrOr(%X, %Y, %Z)
%Y = $X2C('1122')
%Z = $X2C('FF00')
%JUNK = $StrOr(%X, %Y, %Z)
</p>
</p>
would set %JUNK to X'1122FF44FF66'.
</ol>


$StrOr is only available in ''[[Sirius Mods]]'' Version 6.2 and later.
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $StrOr
</p>


[[Category:$Functions|$StrOr]]
[[Category:$Functions|$StrOr]]

Latest revision as of 23:28, 20 September 2018

Bit-wise OR two strings

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $StrOr function is the BitOrString (String function).

This function performs a bit-wise OR of two strings.

The $StrOr function accepts three arguments and returns a string result that is the bit-wise OR of the first two arguments, the shorter being padded with as many copies of the third argument as are required to make the string lengths equal.

Syntax

%STR = $StrOr(string1, string2, [pad])

Syntax terms

%str The bit-wise AND of string1 and string2.
string1 An arbitrary string.
string2 Another arbitrary string.
pad An arbitrary string that is appended to the shorter of the first two strings and replicated as many times as required to make the strings of equal length. If this value is not specified or is null, it defaults to a single null byte (X'00').

Examples

  1. This code fragment would set %junk to X'756333445566':

    %X = $X2C('112233445566') %Y = $X2C('654321') %junk = $StrOr(%X, %Y)

  2. These statements would set %junk to X'DDEEFFCCDDEE':

    %X = $X2C('112233445566') %junk = $StrOr(%X, , $X2C('CC'))

  3. This code fragment would set %junk to X'1122FF44FF66':

    %X = $X2C('112233445566') %Y = $X2C('1122') %Z = $X2C('FF00') %junk = $StrOr(%X, %Y, %Z)

Products authorizing $StrOr