HexToInteger (String function)

From m204wiki
Revision as of 06:12, 31 January 2011 by Goff (talk | contribs) (first pass, match syntax diagram to template and fix tags)
Jump to navigation Jump to search

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