BitOnString (String function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 21: | Line 21: | ||
<li>Using a null <var class="term">string</var> for <var class="term">onBits</var> is an easy way of turning on a specific set of bits for each byte in a string (the <var class="term">pad</var> value). | <li>Using a null <var class="term">string</var> for <var class="term">onBits</var> is an easy way of turning on a specific set of bits for each byte in a string (the <var class="term">pad</var> value). | ||
<li><var>BitOnString</var> is most useful for working with binary data, for example binary data being sent or received with <var class="product">[[Janus Sockets]]</var>. | <li><var>BitOnString</var> is most useful for working with binary data, for example binary data being sent or received with <var class="product">[[Janus Sockets]]</var>. | ||
<li><var>BitOnString</var> was introduced in <var class="product">[[Sirius Mods| | <li><var>BitOnString</var> was introduced in <var class="product">[[Sirius Mods|Sirius Mods]]</var> version 7.9. | ||
</ul> | </ul> | ||
==See also== | ==See also== | ||
{{Template:String:BitOnString footer}} | {{Template:String:BitOnString footer}} |
Revision as of 17:46, 4 May 2011
Set bits in one string from another (String class) [introduced in Sirius Mods 7.9]
BitOnString sets bits in one string as indicated by another.
Syntax
%result = string:BitOnString( onBits, [Pad= c])
Syntax terms
%result | A string to receive the result of setting the bits in onBits for string. |
---|---|
string | The string to set bits in. |
onBits | The bits to set. |
Pad | A single character that indicates the character with which the shorter of the two input strings is to be extended. As many copies of pad are used as is required to make the shorter string as long as the longer. If both strings are of equal length, no padding is required. The default value of pad is '00':x . |
Usage notes
- Using a null string for onBits is an easy way of turning on a specific set of bits for each byte in a string (the pad value).
- BitOnString is most useful for working with binary data, for example binary data being sent or received with Janus Sockets.
- BitOnString was introduced in Sirius Mods version 7.9.