$StrOr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Bit-wise OR two strings<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Bit-wise OR two strings<section end="desc" /></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="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $StrOr function.</p>


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


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').
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').
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %STR = $StrOr(string1, string2, pad)
<p class="syntax"><section begin="syntax" /> %STR = $StrOr(string1, string2, pad)
Line 18: Line 19:
<p class="caption">$StrOr Function
<p class="caption">$StrOr Function
</p>
</p>
<p class="caption">%STR is the bit-wise OR of '''string1''' and '''string2'''.</p>
<p class="caption">%STR is the bit-wise OR of '''string1''' and '''string2'''.</p>
For example
For example
<p class="code"> %X = $X2C('112233445566')
<p class="code"> %X = $X2C('112233445566')
  %Y = $X2C('654321')
  %Y = $X2C('654321')
  %JUNK = $StrOr(%X, %Y)
  %JUNK = $StrOr(%X, %Y)
</p>
</p>
would set %JUNK to X'756333445566' and
would set %JUNK to X'756333445566' and
<p class="code"> %X = $X2C('112233445566')
<p class="code"> %X = $X2C('112233445566')
  %JUNK = $StrOr(%X, , $X2C('CC'))
  %JUNK = $StrOr(%X, , $X2C('CC'))
</p>
</p>
would set %JUNK to X'DDEEFFCCDDEE' and
would set %JUNK to X'DDEEFFCCDDEE' and
<p class="code"> %X = $X2C('112233445566')
<p class="code"> %X = $X2C('112233445566')
  %Y = $X2C('1122')
  %Y = $X2C('1122')
Line 34: Line 41:
  %JUNK = $StrOr(%X, %Y, %Z)
  %JUNK = $StrOr(%X, %Y, %Z)
</p>
</p>
would set %JUNK to X'1122FF44FF66'.  
would set %JUNK to X'1122FF44FF66'.  


$StrOr is only available in ''[[Sirius Mods]]'' Version 6.2 and later.
$StrOr is only available in ''[[Sirius Mods]]'' Version 6.2 and later.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius functions]]</li>
Line 46: Line 55:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p class="caption">Products authorizing $StrOr
<p class="caption">Products authorizing $StrOr
</p>
</p>


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

Revision as of 20:09, 8 February 2011

<section begin="desc" />Bit-wise OR two strings<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $StrOr 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.

The first argument is an arbitrary string.

The second argument is another arbitrary string.

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').

Syntax

<section begin="syntax" /> %STR = $StrOr(string1, string2, pad) <section end="syntax" />

$StrOr Function

%STR is the bit-wise OR of string1 and string2.

For example

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

would set %JUNK to X'756333445566' and

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

would set %JUNK to X'DDEEFFCCDDEE' and

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

would set %JUNK to X'1122FF44FF66'.

$StrOr is only available in Sirius Mods Version 6.2 and later.

Products authorizing $StrOr