ASCII( ) function

Returns the ASCII code for a specified character.

Syntax

ASCII(character)

Parameters

Name Type Description
character character

The character to identify the ASCII code for.

You can specify a quoted character, or a multi-character string, field, or expression. If you specify multiple characters, only the first character is evaluated.

Output

Numeric.

Examples

Basic examples

Returns 65:

ASCII("A")

Returns 49:

ASCII("1")

Advanced examples

Extracting a record that starts with a tab character

Extract records that have a tab character at the beginning of a field called "Description". The ASCII code for a tab character is "9".

EXTRACT RECORD TO "Tab_Entries.acl" IF ASCII(Description) = 9

Remarks

Testing for non-printable characters

You can use ASCII( ) to test for non-printable characters such as:

  • Nul ASCII "0"
  • Tab ASCII "9"
  • Line Feed (LF) ASCII "10"
  • Carriage Return (CR) ASCII "13"

Related functions

ASCII( ) is the inverse of the CHR( ) function.

ACL Scripting Guide 14.1