HEX-ENCODE function
- Last Updated: February 23, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Converts a RAW or MEMPTR value into a string of type LONGCHAR consisting of an even number of hexadecimal digits (0 through 9 and A through F).
Syntax
|
- expression
- A RAW or MEMPTR expression containing the value you want to
convert. If the expression 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-ENCODE function:
|
Running this code produces a sequence of messages showing the byte values: 72, 101,
108, 108, 111, and then a final message with HEX-ENCODE result:
48656C6C6F.