Returns the integer ASCII code for a character in the given string. For a mumps process started in UTF-8 mode, $ASCII() returns the integer Unicode® UTF-8 code-point value of a character in the given string.

The format for the $ASCII function is:

$A[SCII](expr[,intexpr])
  • The expression is the source string from which $ASCII() extracts the character it decodes.

  • intexpr contains the position within the expression of the character that $ASCII() decodes. If intexpr is missing, $ASCII() returns a result based on the first character position.

  • If intexpr evaluates to before the beginning or after the end of the expression, $ASCII() returns a value of negative one (-1).

$ASCII() provides a means of examining non-graphic characters in a string. When used with $CHAR(), $ASCII() also provides a means to perform arithmetic operations on the codes associated with characters.

$ZASCII() is the parallel function of $ASCII(). $ZASCII() interprets the string argument as a sequence of bytes (rather than a sequence of characters) and can perform all byte-oriented $ASCII() operations. For more information, refer to “$ZAscii()”.

loading table of contents...