Author Topic: Converting from Hex to numbers  (Read 1011 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Guest
Converting from Hex to numbers
« on: March 20, 2018, 07:57:51 PM »
in PB we use the VAL function to convert Hex to numbers as below

Code: [Select]
local tempnum as Long
 tempnum = VAL("&H" +"5E65A486")


 do you have an equivalent function in O2?

Charles Pegge

  • Guest
Re: Converting from Hex to numbers
« Reply #1 on: March 20, 2018, 09:37:28 PM »
Yes, we also have val, but o2 will convert strings to numbers and vice-versa automatically.

Code: [Select]
local tempnum as Long
tempnum = VAL("&H" +"5E65A486")
tempnum = VAL("0x" +"5E65A486")
tempnum = "0x"+"5E65A486"
tempnum = "&h5E65A486"

chrisc

  • Guest
Re: Converting from Hex to numbers
« Reply #2 on: March 21, 2018, 04:18:20 AM »
Thanxx Charles, this is a beauty