613-518-1166 info@zimdatabases.com

ZIM Language Reference


< All Topics


Converts an expression to the character data type and sets the length of the result.





Any value, or an expression that yields any value.


A number that specifies the number of characters in the resulting character string. Length can be a constant, a variable, a form field, or a parameter.

Return Value

Character (char), length bytes long.


Use $tocharacter to convert expression to the CHAR data type in an area length bytes long. If length is negative, the result string is set to the maximum possible length.

String comparisons involving this function are case-sensitive.

If expression is a number, the number is converted to character string form in an area length bytes long. If the given area is not large enough to hold the converted value, an error results.


Assume LastName is “Smith “.


Evaluates to “Smi”.


Evaluates to “Smith “.


Evaluates to “50”.


Evaluates to ” 500″ (17 leading spaces).


Evaluates to ” 500″ (14 leading spaces).

list all Emps

  format $tocharacter(FirstName,6), $tocharacter(LastName,9)

$tocharacter changes the width of values being output with a LIST command.


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