Tech Tip: Using PHP to convert Decimal to Hexadecimal
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: August 1, 2011
Here is a quick method that can be used for converting Decimal values to Hexadecimal values using PHP EXECUTE and the dechex php command:
C_TEXT($0;$result) C_LONGINT($1) C_BOOLEAN($phpOK) If (Count parameters=1) $phpOK:=PHP Execute("";"dechex";$result;$1) End if $0:=$result |
If the above code is saved as a project method named UTIL_php_DecToHex it could be used to convert an integer value to a hexadecimal value like so:
C_TEXT($hex) $hex:=UTIL_php_DecToHex(64784) |
In the above example $hex would be equal to "FD10".