Converts a character into its ordinal number value.
$toord(char)
| char | a character string, or any expression that evaluates to a character string |
Number.
Each of the decimal numbers from 0 to 255 represents a character output by your workstation. $Toord converts the given character to the corresponding decimal number.
If char contains more than one character, only the first character is converted.
The number produced by the $toord function can be converted back to a character by the $tochr function.
$toord(" ")
Evaluates to 32 (on ASCII machines).
$toord(tochr(anynumber ))
Evaluates to any number.