$tochr

Converts an ordinal number into a character.

Syntax

$tochr(number)

Parameters

number

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.

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

 

Related Topics