$X2D: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 33: Line 33:
==Products authorizing {{PAGENAMEE}}==  
==Products authorizing {{PAGENAMEE}}==  
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li>
<li>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li>

Revision as of 18:03, 30 October 2014

Convert hex string to integer

Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $X2D function is HexToInteger or HexToString. For a full list of string and numeric conversion functions see List of String methods and List of Float methods.

The $X2D function returns the integer that is represented by the hexadecimal input string.

Syntax

%value = $X2D([hex_string], [width])

Syntax terms

%value The integer value that is represented by the hex_string hexadecimal string.

The leading bit of the hexadecimal string is repeated out to the length derived from the width argument. If the length is less than the length of the hexadecimal string, the leftmost digits of the hexadecimal string are dropped. The hexadecimal string represents an integer using 2's complement.

hex_string The hex string to be converted to an integer. If it is omitted, or is the null string, or contains characters other than '0' through '9', 'A' through 'F', or 'a' through 'f', %value is zero.
width The number of characters to use from hex_string. If width is omitted or is greater than 8, 8 characters are used. If, after conversion to an integer, it is 0 or less, or can't be represented as a 31 bit value, the result of $X2D is zero.

Example

The following request will print the value -1:

B Print $x2d('0F', 1) End

Products authorizing $X2D