Difference between revisions of "IntToHexString"

From NWN Lexicon
Jump to: navigation, search
(bitwise stuff)
Line 23: Line 23:
 
====Description====
 
====Description====
  
This function coverts an integer to a hexadecimal string representation of the same value, so that converting 123 to a hexString would yield “0x0000007b”.
+
This function coverts an integer to a hexadecimal string representation of the same value, so that converting 123 to a hexString would yield "0x0000007b".
  
 
<br /><br />
 
<br /><br />
Line 29: Line 29:
 
====Remarks====
 
====Remarks====
  
If the first numeric system you learned was hexadecimal then these values would be useful for you. For the rest of us normal types stick to the basic string representation.
+
The main use of this is for more easily debugging bitwise operations on integers. Hexidecimal can define values for bitwise operations more easily. See [[int]] and [[Bitwise Operators]] for more inforamtion.
  
 
<br />
 
<br />

Revision as of 13:51, 29 May 2020



IntToHexString(int)

This function converts an int to a string representation of the same hexadecimal value.

string IntToHexString(
    int nInteger
);

Parameters

nInteger

The integer to convert to hexadecimal (base 16).


Description

This function coverts an integer to a hexadecimal string representation of the same value, so that converting 123 to a hexString would yield "0x0000007b".



Remarks

The main use of this is for more easily debugging bitwise operations on integers. Hexidecimal can define values for bitwise operations more easily. See int and Bitwise Operators for more inforamtion.


Version

1.30

Example

int foo = 300;
string bar =  IntToHexString(foo);

See Also

functions: 

IntToString



 author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul