Converts an expression to the character data type and sets the length of the result.
|expression||Any value, or an expression that yields any value.|
|length||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.|
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.