For ASCII value to character you can use $string Can't type the syntax here because it gets translated by the forum software so please look it up in the uLibrary.
You could also use $encode/$decode - although then you'll deal with HEX values (e.g. 65 = 0x41).
HEX to CHAR: $encode("USTRING", $decode("HEX", "41")) => "A" ; please note that $decode will return RAW data and we therfore have to convert it to a string using $encode("USTRING")
CHAR to HEX: $encode("HEX", "A") => "41"
In case you need a numeric value then you additionally have to write a little conversion routine for numeric to HEX and HEX to numeric.
diseli said You could also use $encode/$decode - although then you'll deal with HEX values (e.g. 65 = 0x41).
HEX to CHAR: $encode("USTRING", $decode("HEX", "41")) => "A" ; please note that $decode will return RAW data and we therfore have to convert it to a string using $encode("USTRING")
CHAR to HEX: $encode("HEX", "A") => "41"
In case you need a numeric value then you additionally have to write a little conversion routine for numeric to HEX and HEX to numeric.
Just a quick note: $encode/$decode will only only work with UTF-8 - the output of $decode is UTF-8 and the input of $encode is treated as UTF-8.
4 Comments
Local Administrator
For ASCII value to character you can use $string Can't type the syntax here because it gets translated by the forum software so please look it up in the uLibrary.
Author: Theo Neeskens (tneeskens@itblockz.nl)
Local Administrator
You could also use $encode/$decode - although then you'll deal with HEX values (e.g. 65 = 0x41).
In case you need a numeric value then you additionally have to write a little conversion routine for numeric to HEX and HEX to numeric.
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Hello, There is also the undocumented function $tometa().
Author: Philippe (philippe.grangeray@agfa.com)
Local Administrator
Just a quick note: $encode/$decode will only only work with UTF-8 - the output of $decode is UTF-8 and the input of $encode is treated as UTF-8.
Author: diseli (daniel.iseli@uniface.com)