Skip to content

ASCII (Obsolete Command)

Obsolete

This command is replaced by the Ascii function.

See Also

Purpose

To place the ASCII value of the first character of a string in a variable.

Syntax

ascii
ascii_char
to
ascii_num

Argument Explanation

  • ascii_char: May be of any data class. It is treated as a String regardless of its actual type.
  • ascii_num: May not be a constant or an expression, and may be of any type.

What It Does

Ascii converts a single ASCII character (the first character in ascii_char) to the number (ascii_num) associated with the character in the ASCII character table.

integer code
ascii "AARDVARK" to code

These commands would place a value of 65 in code (the first character of AARDVARK is A, and the ASCII value of A is 65).

Notes

  • Ascii acts only on the first character of ascii_char. Succeeding characters in the value are ignored.
  • The character command does the reverse of ascii; it converts a numeric value into the ASCII character for that value.
  • If ascii_char is empty, the value of ascii_num will be set to zero.
  • The ascii command renders ASCII values as decimal numbers (not hexadecimal).
  • ascii_char and ascii_num may be the same variable.