Hexadecimal conversion formats

PocketBuilder 2.5 allows you to use the String function to convert numeric data to hexadecimal formatting. The statements in the following table apply hexadecimal formatting to the decimal value 12:

Statement

Result

String(12,"hex")

C

String(12,"hex2")

0C

String(12,"hex4")

000C

String(12,"hex8")

0000000C

You can use the Integer or Long functions to convert a hexadecimal string to a decimal value. The following table shows return values for different hexadecimal strings:

Statement

Result

li_foo = Integer ("0xC")

12

ll_foo = Long ("0x3ABC")

15036

ll_foo = Integer ("0x3ZZQ")//invalid hex value

0