HEX-DECODE function
- Last Updated: February 24, 2026
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Converts a character string consisting of an even number of hexadecimal digits (0 through 9 and A through F) into a RAW value.
Syntax
|
- expression
- A character expression containing the value you want to convert.
If the expression does not contain an even number of hexadecimal
digits, or it is the Unknown value (
?), the result is the Unknown value (?). If the expression is a zero-length value, the result is a zero-length value.
Note: The
BASE64-ENCODE,
BASE64-DECODE, HEX-ENCODE, and
HEX-DECODE functions do not do any byte ordering. However, the binary
output of these functions may be a binary data type such as a MEMPTR or RAW. If the target
of these operation’s output is another system where the order of bytes (endianness) differs,
you must first normalize the data to what the receiving side is expecting. Otherwise, the
results may not be as expected. For example, for a MEMPTR value that you are building
yourself, you can use the SET-BYTE-ORDER statement to set the byte order for the
MEMPTR variable before you read or write the value.Example
The following code example illustrates how to use the
HEX-DECODE function:
|
Running this code displays the numeric byte values contained in the MEMPTR
returned by HEX-DECODE, one byte at a time: 72,
101, 108, 108,
111.