Saturday, 2025-01-18, 11:52 AM
Welcome Guest

Blog

Main » 2011 » April » 21
Introduction:
Converting Decimal to Hexadecimal is easy with AutoHotkey, doing that again and again makes your script become longer. So I made a function to make it simpler.

The Code:

Code
; Dec2Hex.ahk

Dec2Hex(Var){
; Convert a decimal integer to hexadecimal:
SetFormat, IntegerFast, hex
Dec2Hex += Var ; Sets Dec2Hex (which previously contained 11) to be 0xb.
Dec2Hex .= "" ; Necessary due to the "fast" mode.
SetFormat, IntegerFast, d
StringTrimLeft, Dec2Hex, Dec2Hex, 2 ; removes 0x from the string
StringUpper, Dec2Hex, Dec2Hex ; makes it all caps
sDec2Hex .= ... Read more »
Views: 13608 | Added by: GarenaZero | Date: 2011-04-21 | Comments (1)