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β
| Type | Parameter | Description |
|---|---|---|
| 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