BitValueString (String function): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%value</th><td>Set to 0 if the requested but number was off, and 1 if it was on.</td></tr> | <tr><th>%value</th><td>Set to 0 if the requested but number was off, and 1 if it was on.</td></tr> | ||
<tr><th>string</th><td>The string for which a bit is to be tested.</td></tr> | |||
<tr><th>string</th> | <tr><th>bitNumber</th><td>The bit number in the input string that is to be tested. Note that this is a bit number not a bit offset. So the first bit in the string is bit number 1.</td></tr> | ||
<td>The string for which a bit is to be tested.</td></tr> | |||
<tr><th>bitNumber</th> | |||
<td>The bit number in the input string that is to be tested. Note that this is a bit number not a bit offset. So the first bit in the string is bit number 1.</td></tr> | |||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
==Examples== | ==Examples== |
Revision as of 01:08, 22 March 2013
Get bit value (0 or 1) in a string (String class)
[Introduced in Model 204 7.5]
This function returns the "value" of a bit in a string: 0 if the requested bit number is off, 1 if it is on.
Syntax
%value = string:BitValueString( bitNumber) Throws InvalidBitNumber
Syntax terms
%value | Set to 0 if the requested but number was off, and 1 if it was on. |
---|---|
string | The string for which a bit is to be tested. |
bitNumber | The bit number in the input string that is to be tested. Note that this is a bit number not a bit offset. So the first bit in the string is bit number 1. |