ASCII Function

The ASCII function converts a string in EBCDIC code into ASCII code.

Format

ASCII(expr)

Parameter(s)

expr

A expression evaluating to the string to be converted.

Description

The ASCII function converts each character of the given expression from its EBCDIC representation value to its ASCII representation value. It is the inverse to the EBCDIC function in mvBASIC.

The ASCII function does not convert a character to its numeric ASCII value, or vice versa. For that purpose, the SEQ and CHAR functions should be used. See SEQ Function and CHAR Function for more information.

See Appendix B: List Of ASCII Codes for a full listing of ASCII codes.

Example

In this application, data is read from a tape which has been written in EBCDIC code. The ASCII function converts it into ASCII code.

READT STRING ELSE

 .

 .

 .

END

STRING = ASCII(STRING)

See Also

Statement and Function Reference