$StrAnd

From m204wiki
Revision as of 17:36, 28 January 2011 by 198.242.244.47 (talk) (Created page with "{{DISPLAYTITLE:$StrAnd}} <span class="pageSubtitle"><section begin="desc" />Bit-wise AND two strings<section end="desc" /></span> <p class="warning">Most Sirius $functions have ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $StrAnd function is to be entered.

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

The $StrAnd function accepts three arguments and returns a string result that is the bit-wise AND 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 = $StrAnd(string1, string2, pad) <section end="syntax" />

$StrAnd Function

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

For example

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

would set %JUNK to X'010221000000' and

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

would set %JUNK to X'000000444444' and

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

would set %JUNK to X'112233005500'.

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

Products authorizing $StrAnd