CHARS function
Syntax
CHARS (dynamic.array)
CALL -CHARS (return.array, dynamic.array)
CALL !CHARS (return.array, dynamic.array)
Description
Use the CHARS function to generate a dynamic array of ASCII characters from the decimal numeric value of each element of dynamic.array.
If you use the subroutine syntax, the resulting dynamic array is returned as return.array.
If any element in the dynamic array is the null value, null is returned for that element. If any element in the dynamic array evaluates to 128, CHAR(128) is returned, not the null value. CHAR(128) is the equivalent of the system variable @NULL.STR.
If NLS mode is enabled, and if any element in the dynamic array evaluates to a number from 129 through 247, the CHARS function generates Unicode characters from x0081 through x00F7. These values correspond to the equivalent ISO 8859-1 (Latin 1) multibyte characters. The evaluation of numbers from 0 through 127, 128, and 248 through 255 remains the same whether NLS is enabled or not.
The UNICHARS function is the recommended method for generating a dynamic array of Unicode characters.
Example
X = CHARS(38:@VM:32:@VM:38)
PRINT X
The dynamic array X comprises three elements: CHAR(38) (an ampersand ( & )), CHAR(32) (a space), and another CHAR(38). The program prints a dynamic array of these elements separated by value marks:
&V V&