Previous Topic: $CHARTOHEX FunctionNext Topic: Compile Debugging


$HEXTOCHAR Function

$HEX‑TO‑CHAR is an alphanumeric function that returns the display representation of the specified hexadecimal expression.

This function has the following format:

$HEX-TO-CHAR(alpha-expression)

The alphanumeric input must have an even number of valid hexadecimal characters.

Example

Assume that a one‑byte hexadecimal field is coded in the data base for each sales region. The following example sets a one‑character alphanumeric working data field SALES.REGION to the non‑printing hexadecimal code.

<SET-PROC>
SELECT
   WHEN PNL.REGION EQ 'EAST'
      SET SALES.REGION = $HEX-TO-CHAR('09')
   WHEN PNL.REGION EQ 'WEST'
      SET SALES.REGION = $HEX-TO-CHAR('0A')
ENDSEL

For more information about $HEX-TO-CHAR function, see the Programming Reference Guide.