Skip to main content
Version: 8.1

ordinal

New in 8.1.8

This function is used by Ignition's Expression language.

Description​

Takes a Unicode character (as a string), and returns the corresponding character code, as an integer.

note

This function can work for ASCII conversions as well, since Unicode and ASCII character codes match for all ASCII characters.

Syntax​

ordinal(string)

  • Parameters

    • String string - A string containing a single Unicode character. If the string does not contain exactly one character, an ExpressionEval error is thrown.
  • Results

    • Integer - The character code associated with the Unicode character.

Examples​

Code Snippet
ordinal("a") //Returns 97.
Code Snippet
ordinal("AA") //Returns Error_ExpressionEval.
Code Snippet
ordinal("ñ") //Returns 241