intAsChar()
EGL maintains the strLib.intAsChar() system function for compatibility with I4GL.
The function returns a character that corresponds to an integer
code point (numeric representation), based on the local character
set where the function runs:
- In ASCII environments, the function returns the ASCII code for the character.
- In EBCDIC environments, the function returns the EBCDIC code.
This function allows you to place a control character (such as BEL or FF) into a variable so you can send it to a console or printer.
The complementary function strLib.charAsInt() returns the code point for a character.
Syntax
strLib.intAsChar(code INT? in)
returns (character CHAR(1)?)
- code
- Input can be any variable or expression that is assignment compatible with the INT type. The variable represents an ASCII or EBCDIC code point. If code is less than 0 or greater than 255, the function throws a RuntimeException.
- character
- The character value corresponding to code in the local character set. If code is null, the function returns a null value.
Example
result = strLib.intAsChar(65);
// result is A on ASCII
Compatibility considerations
| Platform | Issue |
|---|---|
| JavaScript™ generation | The function sysLib.intAsChar() is not supported. |