$tochr

$tochr

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

$tochr

Converts an ordinal number into a character.

Syntax

$tochr(number)

Parameters

numbera 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.

Comments

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

Example

$tochr(32)

Evaluates to a space (on ASCII machines).

$tochr($toord("Z"))

Evaluates to “Z”.

See Also

$left

$substring

$toalpha

$todate

$tonumber

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%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese