CHAR

Elemental Intrinsic Function (Generic): Returns the character in the specified position of the processor's character set. It is the inverse of the function ICHAR.

Syntax

result = CHAR (i [, kind])

i
(Input) Must be of type integer with a value in the range 0 to n - 1, where n is the number of characters in the processor's character set.

kind
(Optional; input) Must be a scalar integer initialization expression.

Results:

The result is of type character with length 1. The kind parameter is that of default character type.

The result is the character in position i of the processor's character set. ICHAR(CHAR (i, kind(c))) has the value I for 0 to n - 1 and CHAR(ICHAR(c), kind(c)) has the value c for any character c capable of representation in the processor.

Specific Name Argument Type Result Type
  INTEGER(1) CHARACTER
  INTEGER(2) CHARACTER
CHAR 1 INTEGER(4) CHARACTER
  INTEGER(8) CHARACTER
1 This specific function cannot be passed as an actual argument.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: ACHAR, IACHAR, ICHAR, Character and Key Code Charts

Examples

CHAR (76) has the value 'L'.

CHAR (94) has the value '^'.