HexToInteger (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (first pass, match syntax diagram to template and fix tags)
Line 1: Line 1:
{{Template:String:HexToInteger subtitle}}
{{Template:String:HexToInteger subtitle}}


This [[Intrinsic classes|intrinsic]] function returns the integer value of a hex-encoded string.
<var>HexToInteger</var> is an [[Intrinsic classes|intrinsic]] function that returns the integer value of a hex-encoded string.


<var>HexToInteger</var> is available as of version 7.5 of the <var class=product>Sirius Mods</var>.
==Syntax==
==Syntax==
{{Template:String:HexToInteger syntax}}
{{Template:String:HexToInteger syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%num</th>
<tr><th>%number</th>
<td>A numeric variable to receive the integer value of the method object string. </td></tr>
<td>A numeric variable to receive the integer value of the method object <var class="term">string</var>.</td></tr>
<tr><th>string</th>
<tr><th><var class="term">string</var></th>
<td>A hex-encoded string value that contains an even number of characters.                           </td></tr>
<td>A hex-encoded string value that contains an even number of characters.</td></tr>
<tr><th>Signed=bool</th>
<tr><th>Signed</th>
<td>This name-required argument (''''Signed'''') is a [[Boolean]] value that indicates whether the method object string is converted to a signed integer. If ''''True'''', the method object is treated as if it were preceded by a negative sign,         a two's complement conversion is performed, and the returned value is preceded by a negative sign.                                                                                                       Signed is an optional argument that defaults to ''''False'''', which                                  produces an unsigned conversion.</td></tr>
<td>This is an optional, but <var>[[Methods#Named parameters|NameRequired]]</var>, argument and is a <var>[[boolean enumeration]]</var>; if you specify a value, the parameter name <var class="term">Signed</var> is required.<p><var class="term">Signed</var> is a <var>[[boolean enumeration]]</var> value that indicates whether the method object string is converted to a signed integer.<ul><li><var class="term">Signed</var> is an optional argument that defaults to <code>False</code>, which produces an unsigned conversion.<li>If <code>Signed=True</code>, the method object <var class="term">string</var> is treated as if it were preceded by a negative sign, a two's complement conversion is performed, and the returned value is preceded by a negative sign.</ul></p></td></tr>
</table>
</table>
==Usage Notes==
<ul><li><var>HexToInteger</var> is available as of version 7.5 of the <var class=product>Sirius Mods</var>.</ul>


==See also==
==See also==
{{Template:String:HexToInteger footer}}
{{Template:String:HexToInteger footer}}

Revision as of 06:12, 31 January 2011

Convert a hexadecimal string to an integer (String class)

[Introduced in Sirius Mods 7.5]


HexToInteger is an intrinsic function that returns the integer value of a hex-encoded string.

Syntax

%number = string:HexToInteger[( [Signed= boolean])] Throws InvalidHexData

Syntax terms

%number A numeric variable to receive the integer value of the method object string.
string A hex-encoded string value that contains an even number of characters.
Signed This is an optional, but NameRequired, argument and is a boolean enumeration; if you specify a value, the parameter name Signed is required.

Signed is a boolean enumeration value that indicates whether the method object string is converted to a signed integer.

  • Signed is an optional argument that defaults to False, which produces an unsigned conversion.
  • If Signed=True, the method object string is treated as if it were preceded by a negative sign, a two's complement conversion is performed, and the returned value is preceded by a negative sign.

Usage Notes

  • HexToInteger is available as of version 7.5 of the Sirius Mods.

See also