Equinox Online Help - Language Reference - A to Z

Home

Chr

Applies to
SyntaxChr(NumberExpression)
Action[Function] Returns the character corresponding to a given ASCII code.
ScopeUsable anywhere.
Notes

The function returns the character corresponding to the ASCII code NumberExpression.

CategoryConversions
See Also Asc, Card, ChoosePrinter, HexNum, HexStr, Lowercase, Ord, Str, StrCase, StrDate, StrTime, Uppercase
Example

The following example displays the string "A B C" on a message dialog.

Message Chr(65) & Chr(66) & Chr(67)

The next example adds up all the digits in an account number, converts the result to a number between 0 and 9, then converts to a character between A and J. The letter is added to the end of the account number.

| Allocate the next account number
AccountNo = NextAccountNo
NextAccountNo = NextAccount + 1

| Make a total of all the digits in the account number

check = 0

for i = 1 to Len(AccountNo)
check = check + AccountNo[i]
next

| Convert to a number between 0 and 9

check = check Mod 10
| Add a letter between A-J to the end of the account number
AccountNo = AccountNo & Chr(65 + check)