613-518-1166 info@zimdatabases.com

ZIM Language Reference


< All Topics


Converts an ordinal number into a character.





a number, or an expression that evaluates to a number

Return Value

Each of the decimal numbers from 0 to 255 represents a character output by your workstation. $tochr converts a given number to the corresponding character.

Note: The ascii character 0 returns an ascii null value. Zim sees the null character as an End of Line character and stops outputting data. In addition, the ascii character 32 (a space) translates to a 0 since the $tochr function expects a number as the parameter. So, $tochr (” “) translates to $tochr(0) and results in the null value. No matter how encountered, a null value in a string truncates the string at the first null character encountered.

If number is negative or greater than 255, the result of the function is $Null.

The character produced by the $tochr function can be converted back to a decimal number by the $toord function.


Ordinal number refers to the decimal numbers 0 to 255 that you computer uses to represent the characters available on your system.



Evaluates to a space (on ASCII machines).


Evaluates to “Z”.


See Also






About Character Literals

About Functional Expressions

Conversion Between Data Types

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents